Fixed scroll and selection issues

* When you visit the page with url# (empty target) it scrolls down - which made setting the URL of the namespace tab to # really bad, plus it was useless since we already handle that click using JS
* Found that this.$toolbarWrapper wasn't pointing to the right place because of a missing .end() call at the end of a chain of jQuery madness

Change-Id: I7dc6953e39d4081f1b91a351bb830e4c18f7b988
This commit is contained in:
Trevor Parscal 2012-08-17 13:11:55 -07:00
parent 41b5244a46
commit dfdc69f994

View file

@ -455,7 +455,6 @@ ve.init.mw.ViewPageTarget.prototype.setupSkinTabs = function () {
$( pVeEdit ).click( ve.bind( this.onEditTabClick, this ) ); $( pVeEdit ).click( ve.bind( this.onEditTabClick, this ) );
// Allow instant switching back to view mode, without refresh // Allow instant switching back to view mode, without refresh
$( '#ca-view a, #ca-nstab-visualeditor a' ) $( '#ca-view a, #ca-nstab-visualeditor a' )
.attr( 'href', '#' )
.click( ve.bind( this.onViewTabClick, this ) ); .click( ve.bind( this.onViewTabClick, this ) );
} }
// Source editing shouldn't highlight the edit tab // Source editing shouldn't highlight the edit tab
@ -619,7 +618,7 @@ ve.init.mw.ViewPageTarget.prototype.attachSaveDialog = function () {
.html( ve.msg( 'minoredit' ) ); .html( ve.msg( 'minoredit' ) );
this.$saveDialog.find( '.ve-init-mw-viewPageTarget-saveDialog-watchList-label' ) this.$saveDialog.find( '.ve-init-mw-viewPageTarget-saveDialog-watchList-label' )
.html( ve.msg( 'watchthis' ) ); .html( ve.msg( 'watchthis' ) );
this.$saveDialog.appendTo( this.$toolbarWrapper ); this.$toolbarWrapper.append( this.$saveDialog );
}; };
/** /**
@ -816,7 +815,8 @@ ve.init.mw.ViewPageTarget.prototype.attachToolbar = function () {
this.$toolbarWrapper = this.$surface.find( '.es-toolbar-wrapper' ) this.$toolbarWrapper = this.$surface.find( '.es-toolbar-wrapper' )
.insertBefore( $( '#firstHeading' ) ) .insertBefore( $( '#firstHeading' ) )
.find( '.es-toolbar' ) .find( '.es-toolbar' )
.slideDown( 'fast' ); .slideDown( 'fast' )
.end();
}; };
/** /**