From 0c0dc2c943f5044860e958b6c00ca42f4e22e2b7 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 3 Oct 2013 12:53:58 +0000 Subject: [PATCH] Just re-ordering for better readability --- .../js/et2_extension_nextmatch_dynheight.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch_dynheight.js b/etemplate/js/et2_extension_nextmatch_dynheight.js index 483bd7b168..f3ac98a978 100644 --- a/etemplate/js/et2_extension_nextmatch_dynheight.js +++ b/etemplate/js/et2_extension_nextmatch_dynheight.js @@ -100,22 +100,24 @@ var et2_dynheight = Class.extend( var bh = Math.max(0,bmaxBot - bminTop); // Calculate the new height of the inner container - var w = this.innerNode.width(); + var h = Math.max(this.minHeight, oh + ot - it - bh - + this.innerMargin - this.outerMargin); + this.innerNode.height(h); + + // Update the width // Some checking to make sure it doesn't overflow the width when user // resizes the window - if(w > this.outerNode.width()) - { - w = this.outerNode.width(); - } + var w = this.outerNode.width(); if (w > $j(window).width()) { // 50px border, totally arbitrary, but we just need to make sure it's inside w = $j(window).width()-50; } - var h = Math.max(this.minHeight, oh + ot - it - bh - - this.innerMargin - this.outerMargin); - this.innerNode.height(h); - + if(w != this.innerNode.outerWidth()) + { + this.innerNode.width(w); + } + // Call the callback function if (typeof _callback != "undefined") {