Some more changes to egw.css to try to avoid it randomly losing rules in iframes

This commit is contained in:
Nathan Gray 2015-09-23 16:22:47 +00:00
parent 45b9d9e745
commit 711ca55433

View File

@ -51,7 +51,7 @@ egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
// Set the current index to the maximum index
var index = sheet ? Math.min(selectorCount, sheet.cssRules.length) : 0;
if (!sheet || !sheet.ownerNode)
if (!sheet || !sheet.ownerNode || sheet.ownerNode.ownerDocument !== _wnd.document)
{
// Generate a style tag, which will be used to hold the newly generated css
// rules.
@ -60,6 +60,9 @@ egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
// Obtain the reference to the styleSheet object of the generated style tag
sheet = style.sheet ? style.sheet : style.styleSheet;
selectorCount = 0;
selectors = {};
}
// Remove any existing rule first, of no rule exists for the