diff options
| author | Christophe Simonis <chs@openerp.com> | 2014-02-20 17:38:15 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2014-02-20 17:38:15 +0100 |
| commit | 4b72678bc74906e552ebc8cace7161901571d2c1 (patch) | |
| tree | d4965fd90f45af167c6a34eec3caad111a309f12 /addons/website/static/src/js/website.editor.newpage.js | |
| parent | 65db3c635eea5324676c8f85d13e0058d66ce1b9 (diff) | |
| parent | d5106a4d34a9b7c52a1ecad7c65331f1fda2e231 (diff) | |
[MERGE] forward port of branch saas-2 up to revid 9195 chs@openerp.com-20140220154517-6y531n1mqtnfnsmr
bzr revid: chs@openerp.com-20140220163815-69sza1kclnh5mavs
Diffstat (limited to 'addons/website/static/src/js/website.editor.newpage.js')
| -rw-r--r-- | addons/website/static/src/js/website.editor.newpage.js | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/addons/website/static/src/js/website.editor.newpage.js b/addons/website/static/src/js/website.editor.newpage.js index 8d3b3e9b6b5..b475223ecd9 100644 --- a/addons/website/static/src/js/website.editor.newpage.js +++ b/addons/website/static/src/js/website.editor.newpage.js @@ -13,16 +13,44 @@ this.$(".oe_content_menu li.divider").removeClass("hidden"); return res; }, + edit: function () { + this.on('rte:ready', this, function () { + $('a:has(span[data-oe-model="website.menu"])').tooltip({ + title: _t('Save this page and use the top "Content" menu to edit the menu.'), + placement: "bottom", + trigger: "hover", + show: 50, + hide: 100, + container: 'body' + }); + }); + return this._super(); + }, events: _.extend({}, website.EditorBar.prototype.events, { 'click a[data-action=new_page]': function (ev) { ev.preventDefault(); website.prompt({ id: "editor_new_page", window_title: _t("New Page"), - input: "Page Title", - }).then(function (val) { + input: _t("Page Title"), + init: function () { + var $group = this.$dialog.find("div.form-group"); + $group.removeClass("mb0"); + + var $add = $( + '<div class="form-group mb0">'+ + '<label class="col-sm-offset-3 col-sm-9 text-left">'+ + ' <input type="checkbox" checked="checked" required="required"/> '+ + '</label>'+ + '</div>'); + $add.find('label').append(_t("Add page in menu")); + $group.after($add); + } + }).then(function (val, field, $dialog) { if (val) { - document.location = '/website/add/' + encodeURI(val); + var url = '/website/add/' + encodeURI(val); + if ($dialog.find('input[type="checkbox"]').is(':checked')) url +="?add_menu=1"; + document.location = url; } }); } |
