Last modified: 2013-09-26 17:22:26 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 T32998, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30998 - Improvements to bookmanager.js
Improvements to bookmanager.js
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
BookManager (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Raylton P. Sousa
: javascript
Depends on:
Blocks: 28011
  Show dependency treegraph
 
Reported: 2011-09-19 16:33 UTC by Helder
Modified: 2013-09-26 17:22 UTC (History)
1 user (show)

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


Attachments

Description Helder 2011-09-19 16:33:47 UTC
Copying from r84906#code-comments,

Since the script at bookmanager.js interacts with the DOM, it should be executed only when document is ready, as in:
$(function() {
	//Code goes here...
});

Besides, I think you should replace
 if ( $prev[0] ) by if ($prev.length)
 if ( $next[0] ) by if ($next.length)

And if would be good idea to add an id for the top navigation and another for the botton, so that $( ' .mw-book-navigation ' ) can be replaced by something like
$( '#some-id-for-top, #some-id-for-bottom' ).find( ' .mw-book-navigation ' )
, which is more efficient. See
[[mw:JavaScript_performance#Selector_performance_.28jQuery.29]]
Comment 1 Helder 2011-10-04 16:34:08 UTC
It seems that the first part is already fixed on trunk:
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/BookManager/client/bookmanager.js?revision=87713&view=markup

I think currently the only thing needed is to use ids for the top/bottom navigation bars.
Comment 2 Krinkle 2011-10-12 02:03:28 UTC
Rephrasing bug summary. Jumped out in general searches and thread views, mentioning book manager now.

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


Navigation
Links