summaryrefslogtreecommitdiff
path: root/addons/website/static
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-11-21 12:51:01 +0100
committerqsm-odoo <qsm@odoo.com>2016-11-23 10:34:18 +0100
commit9a1fd7c940a64055d8435f9c7bc7d4f07ddbd3bf (patch)
treefd1454a8cde08d168cb8735ada211f850a7c07c9 /addons/website/static
parentc56cf85a3a5b92a5f593b813d483f7b3a7989759 (diff)
[FIX] website: fix opening of the SelectEditMenuDialog
When on a page event for example, when the user choose "Edit menu", a modal is first opened to ask which menu to edit (the top menu or the event menu ?). This feature was broken with a web_editor refactoring. Indeed, the dialog was converted to use the standard dialog class but the widget was still inserted in the DOM thanks to "appendTo" instead of the modal built-in "open" method, preventing it to be properly opened.
Diffstat (limited to 'addons/website/static')
-rw-r--r--addons/website/static/src/js/website.contentMenu.js2
-rw-r--r--addons/website/static/src/xml/website.contentMenu.xml12
2 files changed, 8 insertions, 6 deletions
diff --git a/addons/website/static/src/js/website.contentMenu.js b/addons/website/static/src/js/website.contentMenu.js
index d91007a7491..62da0e9e75b 100644
--- a/addons/website/static/src/js/website.contentMenu.js
+++ b/addons/website/static/src/js/website.contentMenu.js
@@ -31,10 +31,10 @@ var TopBarContent = Widget.extend({
var def = $.Deferred();
if ($("[data-content_menu_id]").length) {
var select = new SelectEditMenuDialog();
- select.appendTo(document.body);
select.on('save', this, function (root) {
def.resolve(root);
});
+ select.open();
} else {
def.resolve(null);
}
diff --git a/addons/website/static/src/xml/website.contentMenu.xml b/addons/website/static/src/xml/website.contentMenu.xml
index 1d20236386c..861305396f5 100644
--- a/addons/website/static/src/xml/website.contentMenu.xml
+++ b/addons/website/static/src/xml/website.contentMenu.xml
@@ -22,11 +22,13 @@
</ul>
</li>
</t>
-<select t-name="website.contentMenu.dialog.select" class="form-control mb16" t-if="widget.roots">
- <t t-foreach="widget.roots" t-as="root">
- <option t-att-value="root.id"><t t-esc="root.name"/></option>
- </t>
-</select>
+<div t-name="website.contentMenu.dialog.select">
+ <select class="form-control mb16" t-if="widget.roots">
+ <t t-foreach="widget.roots" t-as="root">
+ <option t-att-value="root.id"><t t-esc="root.name"/></option>
+ </t>
+ </select>
+</div>
<div t-name="website.contentMenu.dialog.edit">
<select class="form-control mb16" t-if="widget.roots">
<t t-foreach="widget.roots" t-as="root">