r63594 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63593‎ | r63594 | r63595 >
Date:11:40, 11 March 2010
Author:jojo
Status:resolved (Comments)
Tags:
Comment:
fix: make sure we have a valid var $
Modified paths:
  • /trunk/extensions/Collection/js/bookcreator.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/js/bookcreator.js
@@ -21,6 +21,11 @@
2222
2323 (function() {
2424
 25+var $ = window.$;
 26+if (typeof $ == 'undefined') {
 27+ $ = jQuery;
 28+}
 29+
2530 function refreshBookCreatorBox(hint, oldid) {
2631 sajax_request_type = 'GET';
2732 sajax_do_call('wfAjaxCollectionGetBookCreatorBoxContent', [hint, oldid], function(xhr) {

Comments

#Comment by Catrope (talk | contribs)   15:47, 11 March 2010

The preferred way to do this is to wrap your code in (function($) { ... code here ... })(jQuery);. Your code is already wrapped in (function() { ... } )(); so this'll be a minor tweak.

#Comment by Jbeigel (talk | contribs)   10:58, 12 March 2010

Thanks :) Committed in r63631.

Status & tagging log