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

Reduces wrong width in admin customfields or categories after you click 3 times.
This commit is contained in:
Nathan Gray 2015-09-22 23:43:20 +00:00
parent b7da91b7dc
commit 9e9cbc2fa1
4 changed files with 31 additions and 10 deletions

View File

@ -4,7 +4,7 @@
<overlay>
<template id="admin.categories.index.right" template="" lang="" group="0" version="1.9.001">
<hbox>
<buttononly align="right" label="Add" id="add" onclick="window.open('$cont[add_link]','_blank','dependent=yes,width=600,height=380,scrollbars=yes,status=yes'); return false;"/>
<buttononly align="right" id="add" onclick="window.open('$cont[add_link]','_blank','dependent=yes,width=600,height=380,scrollbars=yes,status=yes'); return false;"/>
</hbox>
</template>
<template id="admin.categories.index.rows" template="" lang="" group="0" version="1.9.002">

View File

@ -258,6 +258,24 @@ var et2_dataview = Class.extend({
this.columnMgr = null;
}
// Remove dynamic CSS,
for (var i = 0; i < this.columns.length; i++)
{
if(this.columns[i].tdClass)
{
this.egw.css('.'+this.columns[i].tdClass);
}
if(this.columns[i].divClass)
{
this.egw.css('.'+this.columns[i].divClass);
this.egw.css(".egwGridView_outer ." + this.columns[i].divClass);
this.egw.css(".egwGridView_grid ." + this.columns[i].divClass);
}
}
this.egw.css(".egwGridView_grid ." + this.uniqueId + "_div_fullRow");
this.egw.css(".egwGridView_outer ." + this.uniqueId + "_td_fullRow");
this.egw.css(".egwGridView_outer ." + this.uniqueId + "_spacer_fullRow");
// Reset the headerColumns array and empty the table row
this.columnNodes = [];
this.columns = [];

View File

@ -449,7 +449,7 @@
{
case 0:
// Return the global instance
return egw;
return instances['~global~'][0]['instance'];
case 1:
if (typeof arguments[0] === 'string')

View File

@ -49,9 +49,9 @@ egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
*/
css: function(_selector, _rule) {
// Set the current index to the maximum index
var index = selectorCount;
var index = sheet ? Math.min(selectorCount, sheet.cssRules.length) : 0;
if (!sheet)
if (!sheet || !sheet.ownerNode)
{
// Generate a style tag, which will be used to hold the newly generated css
// rules.
@ -67,13 +67,16 @@ egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
{
// Store the old index
index = selectors[_selector];
if (typeof sheet.removeRule !== "undefined")
if(index < sheet.cssRules.length)
{
sheet.removeRule(index);
}
else
{
sheet.deleteRule(index);
if (typeof sheet.removeRule !== "undefined")
{
sheet.removeRule(index);
}
else
{
sheet.deleteRule(index);
}
}
delete (selectors[_selector]);