summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2016-04-22 12:45:03 +0200
committerAaron Bohy <aab@odoo.com>2016-04-25 11:29:59 +0200
commit69cb6088bece965e5fa7eca6ea360d2ef92c2c61 (patch)
tree1a516705940f087c8e9c28616b415c7e4c7bc8a1 /addons/web/static/src/js
parent6719df598875d796a9bbca7f565a00bf07de137d (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/form_view.js6
1 files 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);
}
});