From 0ff2087fb9af17ef2359b3912d424b4ece20951f Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 6 Sep 2018 10:52:55 +0200 Subject: [FIX] web: FieldMany2ManyTags: fix broken colorpicker Before this rev., if the user clicked on a tag to open the color picker, and then clicked in the dropdown, but not on a color, the color picker closed itself, and it was no longer possible to open it again. This issue came with the migration to BS4 and its following fixes. As the color picker is now a classical BS dropdown, it closes itself automatically, so we don't need to manually close it on focusout. Task 1878254. --- addons/web/static/src/js/fields/relational_fields.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 437052d44e2..cf217cf70bc 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -1920,19 +1920,12 @@ var FormFieldMany2ManyTags = FieldMany2ManyTags.extend({ 'click .dropdown-toggle': '_onOpenColorPicker', 'mousedown .o_colorpicker a': '_onUpdateColor', 'mousedown .o_colorpicker .o_hide_in_kanban': '_onUpdateColor', - 'focusout .o_colorpicker': '_onCloseColorPicker', }), //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- - /** - * @private - */ - _onCloseColorPicker: function () { - this.$color_picker.remove(); - }, /** * @private * @param {MouseEvent} ev @@ -1978,7 +1971,7 @@ var FormFieldMany2ManyTags = FieldMany2ManyTags.extend({ $checkbox.prop('checked', !$checkbox.prop('checked')); // toggle checkbox this.prevColors = this.prevColors ? this.prevColors : {}; if ($checkbox.is(':checked')) { - this.prevColors[id] = currentColor + this.prevColors[id] = currentColor; } else { color = this.prevColors[id] ? this.prevColors[id] : 1; } -- cgit v1.2.3