Last modified: 2014-02-12 23:52:50 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 T42196, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40196 - MobileFrontend: initialize JS on DOM-ready, not window.onload
MobileFrontend: initialize JS on DOM-ready, not window.onload
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
stable (Other open bugs)
unspecified
All All
: Highest normal
: ---
Assigned To: Nobody - You can work on this!
http://en.m.wikipedia.org/wiki/Obama
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-12 22:17 UTC by Brion Vibber
Modified: 2014-02-12 23:52 UTC (History)
9 users (show)

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


Attachments

Description Brion Vibber 2012-09-12 22:17:41 UTC
I noticed this little gem in MobileFrontend's HTML template:

	<script type='text/javascript'>
	window.onload = function() {
		mw.mobileFrontend.init();
	};
	</script>

window.onload doesn't fire until all images have been loaded; this includes images in collapsed sections for now.

On long pages like the Obama article <http://en.m.wikipedia.org/wiki/Obama> it's easy to tap into the search box while things are still loading and find that nothing happens when you type -- you have to tap out and tap back in to activate the full-screen search view.

Initialization should be called on DOM-ready or directly in the footer code so that it doesn't have to wait for images.
Comment 1 Jon 2012-09-20 15:27:52 UTC
https://gerrit.wikimedia.org/r/24437
Comment 2 Brion Vibber 2012-09-20 22:17:07 UTC
Merged.

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


Navigation
Links