Add optional jQuery event delegates in Confirmable
authorTim Eulitz <tim.eulitz@wikimedia.de>
Mon, 18 Mar 2019 16:11:56 +0000 (17:11 +0100)
committerTim Eulitz <tim.eulitz@wikimedia.de>
Mon, 18 Mar 2019 16:11:56 +0000 (17:11 +0100)
commit87cadc95325db7ef9ccef2143c9098a451191831
tree1c5e6d20856cdd5e0eb4951460c23aa3339a3d42
parent5612194879bd4f5c7d3e7c75d42b08bf91b84428
Add optional jQuery event delegates in Confirmable

Since we want to use the Confirmable on pages with dynamic content
(RecentChanges for example), we need to add support for event
delegation to confirmables, as this is the most reliable way to attach
the event to new elements on the page.

As a side effect, it should also improve performance since it
reduces the amount of event handlers needed for our use case.

Bug: T218354
Change-Id: I22bea39c371d329b40b76ebadc9b74e6d06bfe13
resources/src/jquery/jquery.confirmable.js