Last modified: 2013-10-19 13:15:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53338, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51338 - mw.notify notifications can't be removed/hidden programmatically
mw.notify notifications can't be removed/hidden programmatically
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Low enhancement (vote)
: 1.22.0 release
Assigned To: Alex Monk
:
Depends on:
Blocks: 51701
  Show dependency treegraph
 
Reported: 2013-07-15 01:58 UTC by Roan Kattouw
Modified: 2013-10-19 13:15 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2013-07-15 01:58:03 UTC
Use case:
* The user opens VisualEditor
* The user types something that looks like wikitext
* VE notices and displays an mw.notify bubble with autoHide:false
* The user leaves VE by clicking on the Read tab
* The editor is torn down and we go back to view mode, but the bubble persists

I would like to be able to remove this bubble when the editor is torn down, but mw.notification doesn't expose an API for this. There is a .close() method on Notification, but there's no way to get the Notification object created by mw.notify().
Comment 1 Alex Monk 2013-07-15 02:25:19 UTC
I had this problem in Gerrit change #5130. Had to depend on mediawiki.notification, add a 'return notif' to the mw.notification.notify function and use that instead of mw.notify.
Comment 2 Bartosz Dziewoński 2013-07-15 17:47:37 UTC
I'd say that this is expected behavior and a "feature" of the shorthand. Just like you can't have a message parsed by just doing mw.msg(), you have to use mw.message().whatever() instead.

Alex's solution makes sense at a glance.
Comment 3 Roan Kattouw 2013-07-18 18:02:27 UTC
(In reply to comment #2)
> I'd say that this is expected behavior and a "feature" of the shorthand. Just
> like you can't have a message parsed by just doing mw.msg(), you have to use
> mw.message().whatever() instead.
> 
> Alex's solution makes sense at a glance.
Returning the Notification object would fix this, yes. Unfortunately, that change is still pending review.
Comment 4 Gerrit Notification Bot 2013-07-18 18:07:12 UTC
Change 74407 had a related patch set uploaded by Alex Monk:
Return Notification object from mw.notification.notify

https://gerrit.wikimedia.org/r/74407
Comment 5 Gerrit Notification Bot 2013-10-19 13:02:22 UTC
Change 74407 merged by jenkins-bot:
mediawiki.notification: Expose close method to hide a Notification

https://gerrit.wikimedia.org/r/74407

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links