diff --git a/resources/skins.minerva.editor/init.js b/resources/skins.minerva.editor/init.js index 862180bdc..c71dd2ff5 100644 --- a/resources/skins.minerva.editor/init.js +++ b/resources/skins.minerva.editor/init.js @@ -168,14 +168,19 @@ * @method */ function logInit( editor ) { - mw.track( 'mf.schemaEdit', { - action: 'init', - type: 'section', - mechanism: initMechanism, - editor: editor, - editingSessionId: editorOptions.sessionId + // If MobileFrontend is not available this will not be possible so + // check first. + mw.loader.using( 'mobile.loggingSchemas.edit' ).done( function () { + mw.track( 'mf.schemaEdit', { + action: 'init', + type: 'section', + mechanism: initMechanism, + editor: editor, + editingSessionId: editorOptions.sessionId + } ); } ); } + /** * Load source editor * @private diff --git a/resources/skins.minerva.mainMenu/MainMenu.js b/resources/skins.minerva.mainMenu/MainMenu.js index 4b51e40cf..e957cf366 100644 --- a/resources/skins.minerva.mainMenu/MainMenu.js +++ b/resources/skins.minerva.mainMenu/MainMenu.js @@ -36,6 +36,8 @@ * attributes on elements. */ enableLogging: function () { + // Load the EventLogging module inside MobileFrontend if available + mw.loader.using( 'mobile.loggingSchemas.mobileWebMainMenuClickTracking' ); this.$( 'a' ).on( 'click', function () { var $link = $( this ), eventName = $link.data( 'event-name' ); diff --git a/skin.json b/skin.json index 47a89cbd4..319e4152d 100644 --- a/skin.json +++ b/skin.json @@ -233,8 +233,7 @@ "dependencies": [ "skins.minerva.mainMenu.icons", "skins.minerva.mainMenu.styles", - "mobile.startup", - "mobile.loggingSchemas.mobileWebMainMenuClickTracking" + "mobile.startup" ], "position": "bottom", "templates": { @@ -360,8 +359,7 @@ "mediawiki.ui.input", "mobile.startup", "skins.minerva.toggling", - "mediawiki.jqueryMsg", - "mobile.loggingSchemas.edit" + "mediawiki.jqueryMsg" ], "messages": { "0": "mobile-frontend-editor-disabled",