From 69cb6088bece965e5fa7eca6ea360d2ef92c2c61 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 22 Apr 2016 12:45:03 +0200 Subject: [PATCH] [FIX] web: form_view: unnecessary jumping Edit button When opening a record from a list view, the Edit button in the control panel sometimes bounced. This was because we listened to event 'mouseup', and astonishingly, the 'mouseup' event of the click in the list view was catched by the form view. The reason why we listened to 'mouseup' instead of 'click' is that some widgets need the event to be propagated to the body. So this fix simply makes the form view listen to 'click' instead of 'mouseup', but removes the call to stopPropagation() on the catched event. --- addons/web/static/src/js/views/form_view.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/views/form_view.js b/addons/web/static/src/js/views/form_view.js index d2c7a21eb04..1d7d707f21f 100644 --- a/addons/web/static/src/js/views/form_view.js +++ b/addons/web/static/src/js/views/form_view.js @@ -109,11 +109,9 @@ var FormView = View.extend(common.FieldManagerMixin, { this.has_been_loaded.resolve(); // Add bounce effect on button 'Edit' when click on readonly page view. - this.$(".oe_title,.o_group").on('mouseup', function (e) { // 'mouseup' event because some widget need bootstrap click event to go up to body + this.$(".oe_title,.o_group").on('click', function (e) { if(self.get("actual_mode") === "view" && self.$buttons && !$(e.target).is('[data-toggle]')) { - var $button = self.$buttons.find(".o_form_button_edit"); - $button.openerpBounce(); - e.stopPropagation(); + self.$buttons.find(".o_form_button_edit").openerpBounce(); core.bus.trigger('click', e); } });