* Fixed failure of the edit toolbar to load when $wgResourceLoaderExperimentalAsyncLo...
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 20 Feb 2012 23:29:47 +0000 (23:29 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 20 Feb 2012 23:29:47 +0000 (23:29 +0000)
* Also fixed breakage of byteLimit on edit in the same scenario.
* For 1.19 backport so no release notes.

resources/mediawiki.action/mediawiki.action.edit.js

index 06fe100..499aba6 100644 (file)
@@ -3,7 +3,7 @@
        var currentFocused = $( '#wpTextbox1' );
 
        mw.toolbar = {
-               $toolbar : $( '#toolbar' ),
+               $toolbar : [],
                buttons : [],
                // If you want to add buttons, use
                // mw.toolbar.addButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId, selectText );
                                );
                        }
                },
-               init : function() {
+
+               // For backwards compatibility
+               init : function() {},
+
+               onReady : function() {
+                       mw.toolbar.$toolbar = $( '#toolbar' );
                        // Legacy
                        // Merge buttons from mwCustomEditButtons
                        var buttons = [].concat( this.buttons, window.mwCustomEditButtons );
        window.addButton =  mw.toolbar.addButton;
        window.insertTags = mw.toolbar.insertTags;
 
-       //make sure edit summary does not exceed byte limit
-       $( '#wpSummary' ).byteLimit( 250 );
-
        $( document ).ready( function() {
+               mw.toolbar.onReady();
+
+               // Make sure edit summary does not exceed byte limit
+               $( '#wpSummary' ).byteLimit( 250 );
+
                /**
                 * Restore the edit box scroll state following a preview operation,
                 * and set up a form submission handler to remember this state