[FIX] web: prevent traceback when double-clicking links in modals
Before this revision, double-clicking links in a modal triggered a traceback. This is because the second click attempts to change the active view while it is still being changed by the first click (more precisely, the controller of the active view is undefined on the second click). This commit ensures that on_attach_callback is called only if the controller is defined. Steps to reproduce the issue fixed by this commit: 1. Open a sales order; 2. Click on a product line; 3. Double-click on the product.
This commit is contained in:
@@ -53,7 +53,8 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
|
||||
*/
|
||||
on_attach_callback: function() {
|
||||
this.is_in_DOM = true;
|
||||
if (this.active_view && this.active_view.controller.on_attach_callback) {
|
||||
var controller = this.active_view && this.active_view.controller;
|
||||
if (controller && this.active_view.controller.on_attach_callback) {
|
||||
this.active_view.controller.on_attach_callback();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user