Admin bugfixes:

- Avoid error Cannot read property 'promise' of undefined
- Reduce wrong width in admin customfields or categories after you click 3 times
This commit is contained in:
Nathan Gray 2015-09-29 14:39:50 +00:00
parent bebfc80259
commit 6450e343c4
4 changed files with 34 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 || 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
@ -67,6 +70,8 @@ egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
{
// Store the old index
index = selectors[_selector];
if(index < sheet.cssRules.length)
{
if (typeof sheet.removeRule !== "undefined")
{
sheet.removeRule(index);
@ -75,6 +80,7 @@ egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
{
sheet.deleteRule(index);
}
}
delete (selectors[_selector]);
}