diff --git a/Math.php b/Math.php index 0f333d8..0e863da 100644 --- a/Math.php +++ b/Math.php @@ -422,6 +422,9 @@ $moduleTemplate = array( $wgResourceModules['ext.math.editbutton.enabler'] = array( 'scripts' => 'ext.math.editbutton.js', + 'dependencies' => array( + 'mediawiki.action.edit', + ), 'messages' => array( 'math_tip', 'math_sample', diff --git a/modules/ext.math.editbutton.js b/modules/ext.math.editbutton.js index 123bed9..b5d9fbd 100644 --- a/modules/ext.math.editbutton.js +++ b/modules/ext.math.editbutton.js @@ -1,13 +1,11 @@ ( function ( mw ) { - if ( mw.toolbar ) { - var iconPath = mw.config.get( 'wgExtensionAssetsPath' ) + '/Math/images/'; - mw.toolbar.addButton( { - imageFile: iconPath + 'button_math.png', - speedTip: mw.msg( 'math_tip' ), - tagOpen: '', - tagClose: '', - sampleText: mw.msg( 'math_sample' ), - imageId: 'mw-editbutton-math' - } ); - } + var iconPath = mw.config.get( 'wgExtensionAssetsPath' ) + '/Math/images/'; + mw.toolbar.addButton( { + imageFile: iconPath + 'button_math.png', + speedTip: mw.msg( 'math_tip' ), + tagOpen: '', + tagClose: '', + sampleText: mw.msg( 'math_sample' ), + imageId: 'mw-editbutton-math' + } ); } ( mediaWiki ) );