diff options
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/js/website.contentMenu.js | 4 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.editor.js | 24 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.js | 5 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.seo.js | 4 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.snippets.gallery.js | 4 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.tour.rte.js | 7 | ||||
| -rw-r--r-- | addons/website/static/src/less/website.ui.components.less | 54 |
7 files changed, 25 insertions, 77 deletions
diff --git a/addons/website/static/src/js/website.contentMenu.js b/addons/website/static/src/js/website.contentMenu.js index 82bbefcf8c2..aa695857746 100644 --- a/addons/website/static/src/js/website.contentMenu.js +++ b/addons/website/static/src/js/website.contentMenu.js @@ -186,8 +186,8 @@ var SelectEditMenuDialog = widget.Dialog.extend({ }, options || {})); }, save: function () { - this.trigger("save", parseInt(this.$el.find("select").val() || null)); - this._super(); + this.final_data = parseInt(this.$el.find("select").val() || null); + this._super.apply(this, arguments); } }); diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 8873703d790..d1e71d064a2 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -54,39 +54,37 @@ website.TopBar.include({ website.TopBarCustomize = Widget.extend({ events: { - 'mousedown a.dropdown-toggle': 'load_menu', - 'click ul a[data-view-id]': 'do_customize', + 'click > ul a[data-view-id]': 'do_customize', }, start: function () { - var self = this; - this.$menu = self.$el.find('ul'); this.view_name = $(document.documentElement).data('view-xmlid'); if (!this.view_name) { this.$el.hide(); } - this.loaded = false; + + if (this.$el.is(".open")) { + this.load_menu(); + } else { + this.$el.one("mousedown", "> a.dropdown-toggle", this.load_menu.bind(this)); + } }, load_menu: function () { - var self = this; - if(this.loaded) { - return; - } + var $menu = this.$el.children("ul"); ajax.jsonRpc('/website/customize_template_get', 'call', { key: this.view_name, + full: false }).then(function (result) { _.each(result, function (item) { - if (item.key === "website.debugger" && !window.location.search.match(/[&?]debug(&|$)/)) return; if (item.header) { - self.$menu.append('<li class="dropdown-header">' + item.name + '</li>'); + $menu.append('<li class="dropdown-header">' + item.name + '</li>'); } else { var $li = $('<li/>', {role: 'presentation'}) .append($('<a/>', {href: '#', 'data-view-id': item.id, role: 'menuitem'}) .append(qweb.render('web_editor.components.switch', {id: 'switch-' + item.id, label: item.name}))); $li.find('input').prop('checked', !!item.active); - self.$menu.append($li); + $menu.append($li); } }); - self.loaded = true; }); }, do_customize: function (e) { diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 046da64ccf7..c765e335f7c 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -175,9 +175,10 @@ odoo.define('website.website', function (require) { }); /* ----- PUBLISHING STUFF ---- */ - $(document).on('click', '.js_publish_management .js_publish_btn', function () { + $(document).on('click', '.js_publish_management .js_publish_btn', function (e) { + e.preventDefault(); + var $data = $(this).parents(".js_publish_management:first"); - var self=this; ajax.jsonRpc($data.data('controller') || '/website/publish', 'call', {'id': +$data.data('id'), 'object': $data.data('object')}) .then(function (result) { $data.toggleClass("css_unpublished css_published"); diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js index 4b5acc8090a..09e6c00a701 100644 --- a/addons/website/static/src/js/website.seo.js +++ b/addons/website/static/src/js/website.seo.js @@ -343,8 +343,8 @@ var Configurator = Dialog.extend({ template: 'website.seo_configuration', events: { 'keyup input[name=seo_page_keywords]': 'confirmKeyword', - 'keyup input[name=seo_page_title]': 'titleChanged', - 'keyup textarea[name=seo_page_description]': 'descriptionChanged', + 'blur input[name=seo_page_title]': 'titleChanged', + 'blur textarea[name=seo_page_description]': 'descriptionChanged', 'click button[data-action=add]': 'addKeyword', }, canEditTitle: false, diff --git a/addons/website/static/src/js/website.snippets.gallery.js b/addons/website/static/src/js/website.snippets.gallery.js index 481ba06e6f3..cde906ca764 100644 --- a/addons/website/static/src/js/website.snippets.gallery.js +++ b/addons/website/static/src/js/website.snippets.gallery.js @@ -67,7 +67,7 @@ options.registry.gallery = options.Class.extend({ }, bind_change: function () { var self = this; - return this.$target.find("img").off('saved').on('saved', function (event, img) { + return this.$target.find("img").off('save').on('save', function (event, img) { var $parent = $(img).parent(); $parent.addClass("saved_active"); var index = self.$target.find(".item.saved_active").index(); @@ -228,7 +228,7 @@ options.registry.gallery = options.Class.extend({ var $container = this.$target.find(".container:first"); var editor = new widget.MediaDialog(null, {select_images: true}, this.$target.closest('.o_editable'), null).open(); var index = Math.max(0, _.max(_.map(this.$target.find("img").get(), function (img) { return img.dataset.index | 0; })) + 1); - editor.on('saved', this, function (attachments) { + editor.on('save', this, function (attachments) { for (var i = 0 ; i < attachments.length; i++) { $('<img class="img img-responsive mb8 mt8"/>') .attr("src", attachments[i].src) diff --git a/addons/website/static/src/js/website.tour.rte.js b/addons/website/static/src/js/website.tour.rte.js index 3026e4c86b2..7785441faa0 100644 --- a/addons/website/static/src/js/website.tour.rte.js +++ b/addons/website/static/src/js/website.tour.rte.js @@ -2,9 +2,12 @@ odoo.define('website.tour.rte', function (require) { 'use strict'; var tour = require("web_tour.tour"); -var local_storage = require('web.local_storage'); +var base = require("web_editor.base"); -tour.register('rte_translator', { test: true }, +tour.register('rte_translator', { + test: true, + wait_for: base.ready() +}, [ { content: "click on Add a language", diff --git a/addons/website/static/src/less/website.ui.components.less b/addons/website/static/src/less/website.ui.components.less index 92a116ca309..e1230d2b358 100644 --- a/addons/website/static/src/less/website.ui.components.less +++ b/addons/website/static/src/less/website.ui.components.less @@ -324,63 +324,9 @@ body .modal { // ACE EDITOR .o_ace_view_editor { - @o-ace-color: #2F3129; - .o-position-absolute(@odoo-navbar-height, 0, 0); position: fixed; - .o-flex-display(); - .o-flex-flow(column, nowrap); z-index: 1001; - background: @o-ace-color; - color: white; - - .o_ace_view_editor_title { - .o-flex(0, 0, auto); - .o-flex-display(); - .o-align-items(center); - .o-justify-content(space-between); - padding: @grid-gutter-width/4; - - > * { - .o-flex(0, 0, auto); - margin: 0 @grid-gutter-width/4; - - &.oe_include_bundles { - .o-flex-display(); - .o-align-items(center); - font-size: 11px; - - > .o_checkbox { - margin-right: @grid-gutter-width/4; - } - } - } - - > select { - .o-flex(0, 1, auto); - min-width: 60px; - } - } - #ace-view-id { - .o-flex(0, 0, auto); - padding: @grid-gutter-width/4 @grid-gutter-width/2; - background-color: lighten(@o-ace-color, 10%); - } - #ace-view-editor { - height: 70%; // in case flex is not supported - .o-flex(1, 1, auto); - .ace_gutter { - cursor: ew-resize; - } - } - - &.oe_ace_open { - opacity: 0.97; - } - &.oe_ace_closed { - z-index: -1000; - opacity: 0; - } } // PLANNER DIALOG |
