Last modified: 2014-02-20 11:02:29 UTC
It would be nice to let mw.notify() return the notification object it creates, so that our code can easily update its contents, pause it, etc.
As of Icd7fd1ac (included in MW 1.22) the .close() method is exposed; other methods are not, though. That patch originally aimed to expose the entire object, but Krinkle suggested not to do that.
I'm using one with autoHide:false to report on progress while a brief operation is ongoing. To do this I'm adding a click() handler to the notification's div, so I can abort the operation if the user closes the notification. I guess it would also meet my needs if I could give an onclose() callback to mw.notify(). But I'd say expose the object. It would let developers do more creative things with the notifications.
I guess this bug just needs a decision from Krinkle then?
I say let's consider what we have here a consensus and just do it. :D
Change 110667 had a related patch set uploaded by Bartosz Dziewoński: mediawiki.notification: Return the Notification object from .notify calls https://gerrit.wikimedia.org/r/110667
Change 110667 merged by jenkins-bot: mediawiki.notification: Return the Notification object from .notify calls https://gerrit.wikimedia.org/r/110667