Use style attributes when storing the previous elment size instead of the literal size of the element #220

This commit is contained in:
Nelson Hart 2013-09-12 10:41:51 -03:00
parent 75ddd299e4
commit 6d6cc363b4

View File

@ -511,7 +511,7 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
return this; return this;
}, },
/** /**
* Function to destroy the viewer and clean up everything created by * Function to destroy the viewer and clean up everything created by
* OpenSeadragon. * OpenSeadragon.
@ -666,7 +666,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
this.previousBody = []; this.previousBody = [];
THIS[ this.hash ].prevElementParent = this.element.parentNode; THIS[ this.hash ].prevElementParent = this.element.parentNode;
THIS[ this.hash ].prevNextSibling = this.element.nextSibling; 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; nodes = body.childNodes.length;
for ( i = 0; i < nodes; i ++ ){ for ( i = 0; i < nodes; i ++ ){
this.previousBody.push( body.childNodes[ 0 ] ); this.previousBody.push( body.childNodes[ 0 ] );
@ -783,8 +784,8 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
//this.container.style.top = 'auto'; //this.container.style.top = 'auto';
} }
this.element.style.height = THIS[ this.hash ].prevElementSize.y + 'px'; this.element.style.width = THIS[ this.hash ].prevElementWidth;
this.element.style.width = THIS[ this.hash ].prevElementSize.x + 'px'; this.element.style.height = THIS[ this.hash ].prevElementHeight;
THIS[ this.hash ].fullPage = false; THIS[ this.hash ].fullPage = false;