mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
Add method that runs after activation, for overriding
Change-Id: I046583e61f328baddb0c09eaff122e991c85f992
This commit is contained in:
parent
7a007e2874
commit
6efd583ff7
|
@ -409,15 +409,7 @@ ve.init.mw.DesktopArticleTarget.prototype.activate = function ( dataPromise ) {
|
||||||
|
|
||||||
$( 'html' ).removeClass( 've-loading' ).addClass( 've-activating' );
|
$( 'html' ).removeClass( 've-loading' ).addClass( 've-activating' );
|
||||||
$.when( this.activatingDeferred, this.toolbarSetupDeferred ).done( function () {
|
$.when( this.activatingDeferred, this.toolbarSetupDeferred ).done( function () {
|
||||||
$( 'html' ).removeClass( 've-activating' ).addClass( 've-active' );
|
target.afterActivate();
|
||||||
// Move original content inside the surface for viewport calculations
|
|
||||||
target.getSurface().$element.prepend( target.$originalContent );
|
|
||||||
if ( !target.editingTabDialog ) {
|
|
||||||
// We have to focus the page after hiding the original content, otherwise
|
|
||||||
// in firefox the contentEditable container was below the view page, and
|
|
||||||
// 'focus' scrolled the screen down.
|
|
||||||
target.getSurface().getView().focus();
|
|
||||||
}
|
|
||||||
} ).fail( function () {
|
} ).fail( function () {
|
||||||
$( 'html' ).removeClass( 've-activating' );
|
$( 'html' ).removeClass( 've-activating' );
|
||||||
} );
|
} );
|
||||||
|
@ -451,6 +443,22 @@ ve.init.mw.DesktopArticleTarget.prototype.activate = function ( dataPromise ) {
|
||||||
return this.activatingDeferred.promise();
|
return this.activatingDeferred.promise();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit mode has finished activating
|
||||||
|
*/
|
||||||
|
ve.init.mw.DesktopArticleTarget.prototype.afterActivate = function () {
|
||||||
|
$( 'html' ).removeClass( 've-activating' ).addClass( 've-active' );
|
||||||
|
// Move original content inside the surface for viewport calculations
|
||||||
|
this.getSurface().$element.prepend( this.$originalContent );
|
||||||
|
if ( !this.editingTabDialog ) {
|
||||||
|
// We have to focus the page after hiding the original content, otherwise
|
||||||
|
// in firefox the contentEditable container was below the view page, and
|
||||||
|
// 'focus' scrolled the screen down.
|
||||||
|
// Support: Firefox
|
||||||
|
this.getSurface().getView().focus();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether we want to switch to view mode or not (displaying a dialog if necessary)
|
* Determines whether we want to switch to view mode or not (displaying a dialog if necessary)
|
||||||
* Then, if we do, actually switches to view mode.
|
* Then, if we do, actually switches to view mode.
|
||||||
|
|
Loading…
Reference in a new issue