[FIX] website snippet: drop

bzr revid: chm@openerp.com-20130919135716-agltvhucaqbcmye6
This commit is contained in:
Christophe Matthieu 2013-09-19 15:57:16 +02:00
parent e7e41de591
commit 53fb7df505
1 changed files with 2 additions and 13 deletions

View File

@ -297,6 +297,7 @@
var dropped = false;
$snippet.draggable({
greedy: true,
helper: 'clone',
zIndex: '1000',
appendTo: 'body',
@ -345,26 +346,14 @@
over: function(){
if( action === 'insert'){
$(this).first().after($toInsert);
} else {
// FIXME: stupid hack to prevent multiple droppable to activate at once ...
// it's not even working properly but it's better than nothing.
$(".oe_drop_zone.oe_hover").removeClass("oe_hover");
$(this).addClass("oe_hover");
}
},
out: function(){
if( action === 'insert'){
$toInsert.detach();
} else {
$(this).removeClass("oe_hover");
}
},
drop: function(){
if (!$(".oe_drop_zone.oe_hover").length) {
return false;
}
dropped = true;
var $target = false;
@ -379,7 +368,7 @@
$target.data("snippet-editor").build_snippet($target);
} else {
$target = $(".oe_drop_zone.oe_hover").first().data('target');
$target = $(this).data('target');
self.create_overlay($target);
if (website.snippet.editorRegistry[snipped_id]) {