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