Fix wrong jQuery assignment to menulist Node in toolbar widget, and replace another jQuery with internal vars

This commit is contained in:
Hadi Nategh 2014-02-27 18:15:08 +00:00
parent 5fab71efab
commit c0c20ed9d2

View File

@ -269,10 +269,10 @@ var et2_toolbar = et2_DOMWidget.extend(
this.actionlist.appendTo(this.div); this.actionlist.appendTo(this.div);
this.actionbox.appendTo(this.div); this.actionbox.appendTo(this.div);
var toolbar = this.actionlist.find('span').children(), var toolbar = this.actionlist.find('span').children(),
toolbox = this.actionbox, toolbox = this.actionbox,
menulist = jQuery(this.actionlist.children()[1]); menulist = jQuery(this.actionbox.children()[1]);
toolbar.draggable({ toolbar.draggable({
cancel:true, cancel:true,
@ -308,11 +308,11 @@ var et2_toolbar = et2_DOMWidget.extend(
tolerance:"touch" tolerance:"touch"
}); });
jQuery('#'+this.id+'-'+'actionlist').droppable({ this.actionlist.droppable({
tolerance:"pointer", tolerance:"pointer",
drop:function (event,ui) { drop:function (event,ui) {
that.set_prefered(ui.draggable.attr('id').replace(that.id+'-',''),"remove"); that.set_prefered(ui.draggable.attr('id').replace(that.id+'-',''),"remove");
ui.draggable.appendTo(jQuery('#'+that.id+'-'+'actionlist')); ui.draggable.appendTo(that.actionlist);
that._build_menu(actions); that._build_menu(actions);
} }
}); });
@ -322,7 +322,7 @@ var et2_toolbar = et2_DOMWidget.extend(
active:'none' active:'none'
}); });
}, },
/** /**
* Add/Or remove an action from prefence * Add/Or remove an action from prefence
* *
@ -358,7 +358,7 @@ var et2_toolbar = et2_DOMWidget.extend(
.attr('id', this.id+'-'+action.id) .attr('id', this.id+'-'+action.id)
.attr('title', (action.hint ? action.hint : action.caption)) .attr('title', (action.hint ? action.hint : action.caption))
.appendTo(this.preference[action.id]?this.actionbox.children()[1]:$j('[data-group='+action.group+']',this.actionlist)); .appendTo(this.preference[action.id]?this.actionbox.children()[1]:$j('[data-group='+action.group+']',this.actionlist));
if ( action.iconUrl) if ( action.iconUrl)
{ {
button.attr('style','background-image:url(' + action.iconUrl + ')'); button.attr('style','background-image:url(' + action.iconUrl + ')');