mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Exit loop in onStackLayoutFocus earlier
The optimization removed in this patch is done twice. The effect is that the loop does not end when it finds a match but the match happens to be the current page. This doesn't change anything. It's really only about performance. Change-Id: I5c2de101eb2f14f814f00cf7eacf46b70346f4c8
This commit is contained in:
parent
6baefa1190
commit
6e18ce647e
|
@ -110,8 +110,7 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onStackLayoutFocus = function
|
|||
// Find the page that an element was focused within
|
||||
var $target = $( e.target ).closest( '.oo-ui-pageLayout' );
|
||||
for ( var name in this.pages ) {
|
||||
// Check for page match, exclude current page to find only page changes
|
||||
if ( this.pages[ name ].$element[ 0 ] === $target[ 0 ] && name !== this.currentPageName ) {
|
||||
if ( this.pages[ name ].$element[ 0 ] === $target[ 0 ] ) {
|
||||
this.setPage( name );
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue