diff --git a/modules/ve-mw/init/targets/ve.init.mw.MobileViewTarget.js b/modules/ve-mw/init/targets/ve.init.mw.MobileViewTarget.js index 1a1c556a16..8010d3afb6 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.MobileViewTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.MobileViewTarget.js @@ -14,15 +14,20 @@ * * @constructor * @param {jQuery} $container Container to render target into + * @param {Object} [config] Configuration options + * @cfg {number} [section] Number of the section target should scroll to */ -ve.init.mw.MobileViewTarget = function VeInitMwMobileViewTarget( $el ) { +ve.init.mw.MobileViewTarget = function VeInitMwMobileViewTarget( $container, config ) { var currentUri = new mw.Uri(); + config = config || {}; // Parent constructor ve.init.mw.Target.call( - this, $el, mw.config.get( 'wgRelevantPageName' ), currentUri.query.oldid + this, $container, mw.config.get( 'wgRelevantPageName' ), currentUri.query.oldid ); + this.section = config.section; + // Events this.connect( this, { 'surfaceReady': 'onSurfaceReady' @@ -55,6 +60,7 @@ ve.init.mw.MobileViewTarget.static.surfaceCommands = [ */ ve.init.mw.MobileViewTarget.prototype.onSurfaceReady = function () { this.$document[0].focus(); + this.restoreEditSection(); }; /**