Last modified: 2014-10-15 00:14:09 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 T47299, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45299 - Standardize page-loaded event across stable/beta/alpha
Standardize page-loaded event across stable/beta/alpha
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
Hygiene (Other open bugs)
unspecified
All All
: Low enhancement
: ---
Assigned To: Jon
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-23 01:31 UTC by Juliusz Gonera
Modified: 2014-10-15 00:14 UTC (History)
8 users (show)

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


Attachments

Description Juliusz Gonera 2013-02-23 01:31:28 UTC
We need a standard event which is fired in every mode (stable/beta/alpha) when a page is ready for modules to bind to. Right now we have:

M.on( 'page-loaded', ... );
$( ... );
M.define( 'module', {
  init: ...
} ); // and mwMobileFrontendConfig.settings.initOnDefine

We should probably just leave the first one and make it consistent in every mode.
Comment 1 Jon 2013-05-10 20:01:16 UTC
Due to the way ResourceLoader works there is no way to trigger a page-loaded event on the first page.

I thus suggest that 
* page-loaded event should only fire for lazy loaded page
Therefore modules can either run (on initially loaded pages) or future loaded pages.
* We should probably just run code for the intially loaded page. e.g. init(); Previously this created problems with tests which couldn't cope with modules self initialising (hence existence of mw.config.set( 'wgInitOnDefine', false ); ) but hopefully this is less of a problem now.
Comment 2 Jon 2014-09-25 16:35:49 UTC
I guess this will go with the death of the ajax loading feature.
Comment 3 Gerrit Notification Bot 2014-10-02 18:47:08 UTC
Change 164141 had a related patch set uploaded by Jdlrobson:
WIP: Remove all the ajax related things.

https://gerrit.wikimedia.org/r/164141
Comment 4 Gerrit Notification Bot 2014-10-14 23:15:46 UTC
Change 164141 merged by jenkins-bot:
Remove all the ajax related things.

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

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


Navigation
Links