[FIX] When drag&dropping a card in kanban view, the record is opened under Firefox.

bzr revid: fme@openerp.com-20120828123906-mc9pbcwb6tiv8da1
This commit is contained in:
Fabien Meghazi 2012-08-28 14:39:06 +02:00
parent 393b477ffe
commit 232a51901c
1 changed files with 8 additions and 0 deletions

View File

@ -286,6 +286,9 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
start: function(event, ui) {
self.currently_dragging.index = ui.item.index();
self.currently_dragging.group = ui.item.parents('.oe_kanban_column:first').data('widget');
ui.item.find('*').on('click.prevent', function(ev) {
return false;
});
},
stop: function(event, ui) {
var record = ui.item.data('widget');
@ -296,6 +299,11 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
if (!(old_group.title === new_group.title && old_group.value === new_group.value && old_index == new_index)) {
self.on_record_moved(record, old_group, old_index, new_group, new_index);
}
setTimeout(function() {
// A bit hacky but could not find a better solution for Firefox (problem not present in chrome)
// http://stackoverflow.com/questions/274843/preventing-javascript-click-event-with-scriptaculous-drag-and-drop
ui.item.find('*').off('click.prevent');
}, 0);
},
scroll: false
});