diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-02-20 12:15:34 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-02-20 17:37:15 +0100 |
| commit | b4d8a270e164ab877e9c521f48870b29adc3cb17 (patch) | |
| tree | 5851d5a70e71c457ba728c952666bfd75ac7c823 /addons/website/static/src/js/website.contentMenu.js | |
| parent | a5361605cb48f518885f4d86aba515a4ce673ac3 (diff) | |
[FIX] web_editor, website: restore content menu feature
Commit 3c9e6c89e7207636c1bdab4ed8118c0c1089d43e made big changes to the
link editor dialog... but also broke many features with it.
Commit 9a1ea6dc08af8b6dc5c5a47277f03f662094d4b2 already fixed some of
them but this commit fixes a bigger one. Indeed, the menu edition
feature was totally broken since the changes. Also, the DOM was messy
which broke form navigation, etc.
This commit also simplifies the LESS which was uselessly big.
Diffstat (limited to 'addons/website/static/src/js/website.contentMenu.js')
| -rw-r--r-- | addons/website/static/src/js/website.contentMenu.js | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/addons/website/static/src/js/website.contentMenu.js b/addons/website/static/src/js/website.contentMenu.js index 3910825405d..c1c0a44a63e 100644 --- a/addons/website/static/src/js/website.contentMenu.js +++ b/addons/website/static/src/js/website.contentMenu.js @@ -321,23 +321,13 @@ var MenuEntryDialog = widget.LinkDialog.extend({ return this._super.apply(this, arguments); }, start: function () { - var self = this; - - this.$(".link-style").remove(); - this.$("label[for=link-new]").text("Menu Label"); - - return $.when(this._super.apply(this, arguments)).then(function () { - var $link_text = self.$('#link-text').focus(); - self.$('#link-page').change(function (e) { - if ($link_text.val()) { return; } - var data = $(this).select2('data'); - $link_text.val(data.create ? data.id : data.text); - $link_text.focus(); - }); - }); + this.$(".o_link_dialog_preview").remove(); + this.$(".window-new, .link-style").closest(".form-group").remove(); + this.$("label[for='o_link_dialog_label_input']").text(_t("Menu Label")); + return this._super.apply(this, arguments); }, save: function () { - var $e = this.$('#link-text'); + var $e = this.$('#o_link_dialog_label_input'); if (!$e.val() || !$e[0].checkValidity()) { $e.closest('.form-group').addClass('has-error'); $e.focus(); |
