Preload mediawiki.notification when we know we're going to need it soon
authorBartosz Dziewoński <matma.rex@gmail.com>
Sat, 15 Feb 2014 16:17:08 +0000 (17:17 +0100)
committerOri.livneh <ori@wikimedia.org>
Wed, 19 Feb 2014 08:59:45 +0000 (08:59 +0000)
commitf51b6015d84a9d67caa6b4a24b8420364ee49843
treedc449d29e238a171ca7008517f5fd40ea4989dff
parentc720f78fad0b73ec4b49e9d4bb612d174f0e8112
Preload mediawiki.notification when we know we're going to need it soon

The mediawiki.notification module is normally lazy-loaded when
mw.notify() is called; however, this results in often-noticeable delay
between when the action we're notifying about is complete and when the
actual notification appears.

Let's explicitly mw.loader.load() the module in event handlers which
are going to later asynchronously fire a notification. I could only
find two such situations in core: in mediawiki.page.patrol.ajax and
mediawiki.page.watch.ajax.

Bug: 53990
Change-Id: I9d20af3a2f261cd93d5d5fd2b81cccae79697481
resources/mediawiki.page/mediawiki.page.patrol.ajax.js
resources/mediawiki.page/mediawiki.page.watch.ajax.js