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,12 +149,14 @@ 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
if (jQuery(self.DOMContainer).is(":visible")) {
self._widgetContainer.iterateOver(function (_widget) {
_widget.resize(excess_height);
}, self, et2_IResizeable);
}
}
}, 100);
}
// Initial resize needs to be resized immediately (for instance for nextmatch resize)

View File

@ -197,13 +197,16 @@ 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
if(jQuery(self.DOMContainer).is(":visible"))
{
self._widgetContainer.iterateOver(function (_widget)
{
_widget.resize(excess_height);
}, self, et2_IResizeable);
}
}
}, 100);
}
// Initial resize needs to be resized immediately (for instance for nextmatch resize)