Etemplate: Do not bother to resize hidden etemplates

Fixes Admin > App > Site config gets resized incorrectly when switching to another app's tab & back
This commit is contained in:
nathangray 2020-07-22 15:51:15 -06:00
parent 0d426ae911
commit 3e9794e526
2 changed files with 13 additions and 8 deletions

View File

@ -149,11 +149,13 @@ var etemplate2 = /** @class */ (function () {
// For templates which have sub templates and they are bigger than screenHeight
if (screen.availHeight < jQuery(self._DOMContainer).height())
excess_height = 0;
// Call the "resize" event of all functions which implement the
// If we're visible, call the "resize" event of all functions which implement the
// "IResizeable" interface
self._widgetContainer.iterateOver(function (_widget) {
_widget.resize(excess_height);
}, self, et2_IResizeable);
if (jQuery(self.DOMContainer).is(":visible")) {
self._widgetContainer.iterateOver(function (_widget) {
_widget.resize(excess_height);
}, self, et2_IResizeable);
}
}
}, 100);
}

View File

@ -197,12 +197,15 @@ export class etemplate2
// For templates which have sub templates and they are bigger than screenHeight
if (screen.availHeight < jQuery(self._DOMContainer).height()) excess_height = 0;
// Call the "resize" event of all functions which implement the
// If we're visible, call the "resize" event of all functions which implement the
// "IResizeable" interface
self._widgetContainer.iterateOver(function (_widget)
if(jQuery(self.DOMContainer).is(":visible"))
{
_widget.resize(excess_height);
}, self, et2_IResizeable);
self._widgetContainer.iterateOver(function (_widget)
{
_widget.resize(excess_height);
}, self, et2_IResizeable);
}
}
}, 100);
}