From 0cd17b6cf9231e60083958d85759d4796f505342 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 29 Feb 2012 13:48:11 -0800 Subject: Fix for selection bug due to bad scrollLeft and scrollTop values when switching between documents. Signed-off-by: Nivesh Rajbhandari --- js/document/html-document.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/document/html-document.js b/js/document/html-document.js index 9dcea8cb..581bbc08 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -719,15 +719,14 @@ exports.HTMLDocument = Montage.create(TextDocument, { - if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){ + if((this.savedLeftScroll !== null) && (this.savedTopScroll !== null)){ this.application.ninja.stage._iframeContainer.scrollLeft = this.savedLeftScroll; - this.application.ninja.stage._scrollLeft = this.savedLeftScroll; this.application.ninja.stage._iframeContainer.scrollTop = this.savedTopScroll; - this.application.ninja.stage._scrollLeft = this.savedTopScroll; + this.application.ninja.stage.handleScroll(); } this.application.ninja.currentSelectedContainer = this.documentRoot; - if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null)){ + if(!this.selectionModel){ this.application.ninja.selectedElements = this.selectionModel.slice(0); } -- cgit v1.2.3 From 84d6f6f5518e5ef8fc3d68be7e41c510f57b597a Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 29 Feb 2012 13:53:45 -0800 Subject: Fixing typo. Signed-off-by: Nivesh Rajbhandari --- js/document/html-document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/document/html-document.js b/js/document/html-document.js index 581bbc08..544c0ad5 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -726,7 +726,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { } this.application.ninja.currentSelectedContainer = this.documentRoot; - if(!this.selectionModel){ + if(this.selectionModel){ this.application.ninja.selectedElements = this.selectionModel.slice(0); } -- cgit v1.2.3