From 23f94d5b6ae0345b65e0353bbedec8d288b96f53 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Mon, 7 Apr 2014 14:32:36 +0200 Subject: [PATCH] Add dependency for math edit button Declare that ext.math.editbutton.enabler depends on mediawiki.action.edit. Follow up to: I3d126c1c252c27fa65ab8fb42ffab66a2d99cfa8 Bug: 60471 Change-Id: Ibcda91bbb164b0b896d4c3f5f7c2c6ea6658468e --- Math.php | 3 +++ modules/ext.math.editbutton.js | 20 +++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) 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 ) );