mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 17:48:56 +01:00
Correct stored toolbar's preferences with the wrong id
This commit is contained in:
parent
0d2932d0a6
commit
eec3ebbc5d
@ -64,6 +64,9 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
|
|||||||
this.div = $j(document.createElement('div'))
|
this.div = $j(document.createElement('div'))
|
||||||
.addClass('et2_toolbar ui-widget-header ui-corner-all');
|
.addClass('et2_toolbar ui-widget-header ui-corner-all');
|
||||||
|
|
||||||
|
// Set proper id and dom_id for the widget
|
||||||
|
this.set_id(this.id);
|
||||||
|
|
||||||
//actionbox is the div for stored actions
|
//actionbox is the div for stored actions
|
||||||
this.actionbox = $j(document.createElement('div'))
|
this.actionbox = $j(document.createElement('div'))
|
||||||
.addClass("et2_toolbar_activeList")
|
.addClass("et2_toolbar_activeList")
|
||||||
@ -107,7 +110,21 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
|
|||||||
this.actionbox.append('<div id="' + this.id + '-menulist' +'" class="ui-toolbar-menulist" ></div>');
|
this.actionbox.append('<div id="' + this.id + '-menulist' +'" class="ui-toolbar-menulist" ></div>');
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
var pref = egw.preference(this.id,this.egw().getAppName());
|
// toolbar preference id correction,
|
||||||
|
// before toolbar used to address pereference with this.id which were not scalable
|
||||||
|
// need to convert them to dom_id prefix for old pref and the new one come with dom_id automatically
|
||||||
|
//TODO: this part of code needs to be removed later
|
||||||
|
var old_pref = egw.preference(this.id,this.egw().getAppName());
|
||||||
|
if (old_pref)
|
||||||
|
{
|
||||||
|
//Set the old preference with correct id
|
||||||
|
egw.set_preference(this.egw().getAppName(), this.dom_id,old_pref);
|
||||||
|
// delete stored pref with wrong id
|
||||||
|
egw.set_preference(this.egw().getAppName(),this.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var pref = egw.preference(this.dom_id,this.egw().getAppName());
|
||||||
if (pref && !jQuery.isArray(pref)) this.preference = pref;
|
if (pref && !jQuery.isArray(pref)) this.preference = pref;
|
||||||
|
|
||||||
//Set the default actions for the first time
|
//Set the default actions for the first time
|
||||||
@ -312,7 +329,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
|
|||||||
if (that.actionlist.find(".ui-draggable").length == 0)
|
if (that.actionlist.find(".ui-draggable").length == 0)
|
||||||
{
|
{
|
||||||
that.preference = {};
|
that.preference = {};
|
||||||
egw.set_preference(that.egw().getAppName(),that.id,that.preference);
|
egw.set_preference(that.egw().getAppName(),that.dom_id,that.preference);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tolerance:"touch"
|
tolerance:"touch"
|
||||||
@ -359,11 +376,11 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
|
|||||||
{
|
{
|
||||||
case "add":
|
case "add":
|
||||||
this.preference[_action] = true;
|
this.preference[_action] = true;
|
||||||
egw.set_preference(this.egw().getAppName(),this.id,this.preference);
|
egw.set_preference(this.egw().getAppName(),this.dom_id,this.preference);
|
||||||
break;
|
break;
|
||||||
case "remove":
|
case "remove":
|
||||||
delete this.preference[_action];
|
delete this.preference[_action];
|
||||||
egw.set_preference(this.egw().getAppName(),this.id,this.preference);
|
egw.set_preference(this.egw().getAppName(),this.dom_id,this.preference);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user