From 6d6cc363b42fe8a3e091e6471fb57ea8af46ce7b Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Thu, 12 Sep 2013 10:41:51 -0300 Subject: [PATCH] Use style attributes when storing the previous elment size instead of the literal size of the element #220 --- src/viewer.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index f1880afc..39ea9c0b 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -511,7 +511,7 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype, return this; }, - + /** * Function to destroy the viewer and clean up everything created by * OpenSeadragon. @@ -666,7 +666,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype, this.previousBody = []; THIS[ this.hash ].prevElementParent = this.element.parentNode; THIS[ this.hash ].prevNextSibling = this.element.nextSibling; - THIS[ this.hash ].prevElementSize = $.getElementSize( this.element ); + THIS[ this.hash ].prevElementWidth = this.element.style.width; + THIS[ this.hash ].prevElementHeight = this.element.style.height; nodes = body.childNodes.length; for ( i = 0; i < nodes; i ++ ){ this.previousBody.push( body.childNodes[ 0 ] ); @@ -783,8 +784,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype, //this.container.style.top = 'auto'; } - this.element.style.height = THIS[ this.hash ].prevElementSize.y + 'px'; - this.element.style.width = THIS[ this.hash ].prevElementSize.x + 'px'; + this.element.style.width = THIS[ this.hash ].prevElementWidth; + this.element.style.height = THIS[ this.hash ].prevElementHeight; THIS[ this.hash ].fullPage = false;