From dbb6adf80635a032345b434eca9f98e845bf1ca0 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 21 Jan 2014 13:52:32 +0000 Subject: [PATCH] Fix no drop place when there's no action in toolbar widget --- etemplate/js/et2_widget_toolbar.js | 18 +++++++++++++++++- etemplate/templates/default/etemplate2.css | 10 ++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_toolbar.js b/etemplate/js/et2_widget_toolbar.js index 4b8a62e820..244456c5a1 100644 --- a/etemplate/js/et2_widget_toolbar.js +++ b/etemplate/js/et2_widget_toolbar.js @@ -203,6 +203,10 @@ var et2_toolbar = et2_DOMWidget.extend( drop:function (event, ui) { that.set_prefered(ui.draggable.attr('id').replace(that.id+'-',''),"add"); ui.draggable.appendTo(menulist); + if (that.actionlist.find(".ui-draggable").length == 1) + { + that.actionlist.addClass("ui-toolbar_dropShadow"); + } }, tolerance:"pointer" }); @@ -212,12 +216,24 @@ var et2_toolbar = et2_DOMWidget.extend( drop:function (event,ui) { that.set_prefered(ui.draggable.attr('id').replace(that.id+'-',''),"remove"); ui.draggable.appendTo(jQuery('#'+that.id+'-'+'actionlist')); + that.actionlist.removeClass("ui-toolbar_dropShadow"); } }); toolbox.accordion({ heightStyle:"fill", 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"); + } + } }); }, diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index c41bd55567..56ff38ad4f 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -1178,3 +1178,13 @@ div.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button { .ms-res-ctn { overflow-x: hidden; } +/** +* et2_toolbar +*/ +.ui-toolbar_dropShadow { + height: 100%; + border: dashed; + border-width: 1px; + border-color: gray; + opacity:0.7; +} \ No newline at end of file