From 47bed4e1c8f61a91afd5a71d35b6e60961546522 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Thu, 19 Aug 2021 15:39:20 +0200 Subject: [PATCH] Use page ID string instead of object reference You will see where I'm going with this in the following patches. Bug: T288827 Change-Id: Ifd52369d19c01499fb9cc801c3deec46c26810fd --- modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js index ce7ca44092..03fe295677 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js @@ -113,7 +113,7 @@ ve.ui.MWTemplateDialog.prototype.onReplacePart = function ( removed, added ) { removed.disconnect( this ); } if ( this.loaded && !this.preventReselection && partPage.isActive() ) { - reselect = this.bookletLayout.findClosestPage( partPage ); + reselect = this.bookletLayout.findClosestPage( partPage ).getName(); } removePages.push( partPage ); this.bookletLayout.removePages( removePages ); @@ -153,7 +153,7 @@ ve.ui.MWTemplateDialog.prototype.onReplacePart = function ( removed, added ) { } } } else if ( reselect ) { - this.transclusions.focusPart( reselect.getName() ); + this.transclusions.focusPart( reselect ); } if ( this.loaded && ( added || removed ) ) {