[FIX] web: m2m tags, wait for deferred

We have to wait that the request getting the fields data is resolved
before using it.

Completing 655b13b0
This commit is contained in:
Nicolas Lempereur
2015-09-22 17:41:21 +02:00
committed by Olivier Dony
parent 0d1240684a
commit 17ce3fafb2
@@ -1467,17 +1467,18 @@ var FieldMany2ManyTags = AbstractManyField.extend(common.CompletionFieldMixin, c
}
},
open_color_picker: function(ev){
this.mutex.exec(function(){
if (this.fields.color) {
this.$color_picker = $(QWeb.render('FieldMany2ManyTag.colorpicker', {
'widget': this,
'tag_id': $(ev.currentTarget).data('id'),
}));
if (this.fields.color) {
this.$color_picker = $(QWeb.render('FieldMany2ManyTag.colorpicker', {
'widget': this,
'tag_id': $(ev.currentTarget).data('id'),
}));
$(ev.currentTarget).append(this.$color_picker);
this.$color_picker.dropdown('toggle');
this.$color_picker.attr("tabindex", 1).focus();
}
$(ev.currentTarget).append(this.$color_picker);
this.$color_picker.dropdown('toggle');
this.$color_picker.attr("tabindex", 1).focus();
}
}.bind(this));
},
close_color_picker: function(){
this.$color_picker.remove();