Skip to content

Commit

Permalink
forgot a global. inject it too
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Aug 10, 2023
1 parent a5bef32 commit f2b4ca5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions twinkle.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ class TwinkleMenuBuilder {
* @param {Object} document DOM
* @param {function} $ JQuery
* @param {Object} collapsibleTabs A global related to something in the Vector Legacy skin
* @param {Object} mwUtil The mw.util global
*/
constructor(skin, document, $, collapsibleTabs) {
constructor(skin, document, $, collapsibleTabs, mwUtil) {
/** @type {String} MediaWiki skin name, e.g. vector, vector-2022, monobook, etc. */
this.skin = skin;

Expand All @@ -212,6 +213,9 @@ class TwinkleMenuBuilder {
/** @type {Object} collapsibleTabs A global related to something in the Vector Legacy skin */
this.collapsibleTabs = collapsibleTabs;

/** @type {Object} The mw.util global */
this.mwUtil = mwUtil;

/** @type {String} id of the target navigation area (skin dependant, on vector either of "left-navigation", "right-navigation", or "mw-panel") */
this.navigation = '';

Expand Down Expand Up @@ -416,7 +420,7 @@ class TwinkleMenuBuilder {
*/
addPortletLink(task, text, id, tooltip) {
this.addPortlet(mw.config.get('skin'));
var link = mw.util.addPortletLink(
var link = this.mwUtil.addPortletLink(
this.id,
typeof task === 'string' ? task : '#',
text,
Expand All @@ -437,7 +441,7 @@ class TwinkleMenuBuilder {
}
}

Twinkle.MenuBuilder = new TwinkleMenuBuilder(mw.config.get('skin'), document, $, $.collapsibleTabs);
Twinkle.MenuBuilder = new TwinkleMenuBuilder(mw.config.get('skin'), document, $, $.collapsibleTabs, mw.util);

/**
* **************** General initialization code ****************
Expand Down

0 comments on commit f2b4ca5

Please sign in to comment.