* Addressbook: fixed sorting of category tree

fixes not displayed cat-tree and validation error introduced with r47575
This commit is contained in:
Ralf Becker
2014-07-09 11:18:47 +00:00
parent 6d9421e034
commit 2a6168a1c2
2 changed files with 21 additions and 6 deletions

View File

@ -151,7 +151,7 @@ var et2_tree = et2_inputWidget.extend(
// Try again according to ID
if(!content_options) content_options = this.getArrayMgr("sel_options").getEntry(this.id);
if(_attrs["select_options"] && content_options)
if(_attrs["select_options"] && !jQuery.isEmptyObject(_attrs["select_options"]) && content_options)
{
_attrs["select_options"] = jQuery.extend({},_attrs["select_options"],content_options);
} else if (content_options) {
@ -250,10 +250,11 @@ var et2_tree = et2_inputWidget.extend(
}
// Structure data for category tree
if(this._type == 'tree-cat' && !jQuery.isArray(options)) {
if(this._type == 'tree-cat')
{
var data = {id:0,item:[]};
var stack = [];
for(var key in options)
var stack = {};
for(var key=0; key < options.length; key++)
{
// See if item has an icon
if(options[key].data && typeof options[key].data.icon !== 'undefined' && options[key].data.icon)