From f073db1f63091a00af6f0af956974fac1e2ffb4f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 7 Feb 2014 10:33:05 +0000 Subject: [PATCH] fixed toolbar preference sometimes not stored (caused by them being an array) --- etemplate/js/et2_widget_toolbar.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/etemplate/js/et2_widget_toolbar.js b/etemplate/js/et2_widget_toolbar.js index 86c677f962..50ed675d12 100644 --- a/etemplate/js/et2_widget_toolbar.js +++ b/etemplate/js/et2_widget_toolbar.js @@ -31,7 +31,7 @@ var et2_toolbar = et2_DOMWidget.extend( "type": "string", "default": "3", "description": "Define minimum action view range to show actions by both icons and caption" - }, + } }, /** @@ -66,10 +66,6 @@ var et2_toolbar = et2_DOMWidget.extend( this.dropdowns = {}; this.preference = {}; - if (typeof this.preference != "undefined") - { - console.log(); - } this._build_menu(this.default_toolbar); }, @@ -99,7 +95,8 @@ var et2_toolbar = et2_DOMWidget.extend( this.actionbox.append(''+egw.lang('more')+' ...'+''); this.actionbox.append('
'); - this.preference = egw.preference(this.id,this.egw().getAppName())?egw.preference(this.id,this.egw().getAppName()):this.preference; + var pref = egw.preference(this.id,this.egw().getAppName()); + if (pref && !jQuery.isArray(pref)) this.preference = pref; this.countActions = Object.keys(actions).length - Object.keys(this.preference).length; var last_group = false; var last_group_id = false; @@ -234,7 +231,7 @@ var et2_toolbar = et2_DOMWidget.extend( toolbox.accordion({ heightStyle:"fill", collapsible: true, - active:'none', + active:'none' }); }, @@ -250,7 +247,7 @@ var et2_toolbar = et2_DOMWidget.extend( switch(_do) { case "add": - this.preference[_action] = _action; + this.preference[_action] = true; egw.set_preference(this.egw().getAppName(),this.id,this.preference); break; case "remove":