From bd2e783d30ece1f2b56d492ed1dc704d96d548a0 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 5 Jan 2018 15:45:57 +0100 Subject: [PATCH] [FIX] web: DebugManager in dialogs For actions executed in dialogs (target='new'), a DebugManager is instantiated and appended to the dialog's header (div with classname 'modal-header'). However, in the full composer dialog (in a chatter, click on 'Send message', and then click on the expand icon), there are more than one element matching the selector '.modal-header', because it also occurs in the html generated by summernote. In this case, the widget's $el is cloned and appended to each element of the JQuery nodeset matching the given selector, but widget.$el only refers to one of those. So when it isn't the one appended in the real dialog's header, the debug manager remains empty as the widget isn't able to populate it correctly. This bug appeared with rev. 5f1ef09, as before it, the debug manager was appended to the dialog before its content. --- addons/web/static/src/js/widgets/debug_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/widgets/debug_manager.js b/addons/web/static/src/js/widgets/debug_manager.js index 8007dc2ab7e..d6069f7d4ec 100644 --- a/addons/web/static/src/js/widgets/debug_manager.js +++ b/addons/web/static/src/js/widgets/debug_manager.js @@ -782,7 +782,7 @@ if (core.debug) { // Instantiate the DebugManager and insert it into the DOM once dialog is opened this.opened(function() { self.debug_manager = new DebugManager(self); - var $header = self.$modal.find('.modal-header'); + var $header = self.$modal.find('.modal-header:first'); return self.debug_manager.prependTo($header).then(function() { self.debug_manager.update('action', parent.dialog_widget.action, parent.dialog_widget); });