Switch tabs from read to edit when loading editor.

On cleanup, switch tabs back

Change-Id: Iefb47536e21cd7763c0d75c976109aeb2cbecf50
This commit is contained in:
Rob Moen 2012-05-25 15:41:22 -07:00
parent 237c0fd21f
commit 4ca26f1805

View file

@ -24,6 +24,9 @@
$('#ca-edit > span > a').click( function( e ){
// hijack the edit link
e.preventDefault();
$('#ca-view').removeClass('selected');
$('#ca-edit').addClass('selected');
_this.showSpinner();
// async init
mw.loader.using( 'ext.visualEditor.ve', function(){
@ -102,6 +105,8 @@
veCore.prototype.cleanup = function(){
$('#ve-editor').remove();
$('#ve-loader-spinner').remove();
$('#ca-view').addClass('selected');
$('#ca-edit').removeClass('selected');
this.$content
.find('#mw-content-text, #bodyContent, #firstHeading').show();
};