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.
Version: 1.23.0
Severity: enhancement
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.
Version: 1.23.0
Severity: enhancement
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.
Change 110667 had a related patch set uploaded by Bartosz Dziewoński:
mediawiki.notification: Return the Notification object from .notify calls
Change 110667 merged by jenkins-bot:
mediawiki.notification: Return the Notification object from .notify calls