Fix no drop place when there's no action in toolbar widget

This commit is contained in:
Hadi Nategh 2014-01-21 13:52:32 +00:00
parent 81ed37dab5
commit dbb6adf806
2 changed files with 27 additions and 1 deletions

View File

@ -203,6 +203,10 @@ var et2_toolbar = et2_DOMWidget.extend(
drop:function (event, ui) { drop:function (event, ui) {
that.set_prefered(ui.draggable.attr('id').replace(that.id+'-',''),"add"); that.set_prefered(ui.draggable.attr('id').replace(that.id+'-',''),"add");
ui.draggable.appendTo(menulist); ui.draggable.appendTo(menulist);
if (that.actionlist.find(".ui-draggable").length == 1)
{
that.actionlist.addClass("ui-toolbar_dropShadow");
}
}, },
tolerance:"pointer" tolerance:"pointer"
}); });
@ -212,12 +216,24 @@ var et2_toolbar = et2_DOMWidget.extend(
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(jQuery('#'+that.id+'-'+'actionlist'));
that.actionlist.removeClass("ui-toolbar_dropShadow");
} }
}); });
toolbox.accordion({ toolbox.accordion({
heightStyle:"fill", heightStyle:"fill",
collapsible: true, collapsible: true,
active:'none' active:'none',
activate:function(event,ui)
{
if (that.actionlist.find(".ui-draggable").length == 0 && ui.oldPanel.length == 0)
{
that.actionlist.addClass("ui-toolbar_dropShadow");
}
else if(that.actionlist.find(".ui-draggable").length == 0 && ui.newPanel.length == 0)
{
that.actionlist.removeClass("ui-toolbar_dropShadow");
}
}
}); });
}, },

View File

@ -1178,3 +1178,13 @@ div.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
.ms-res-ctn { .ms-res-ctn {
overflow-x: hidden; overflow-x: hidden;
} }
/**
* et2_toolbar
*/
.ui-toolbar_dropShadow {
height: 100%;
border: dashed;
border-width: 1px;
border-color: gray;
opacity:0.7;
}