diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-10-19 18:16:14 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-10-19 18:16:14 +0200 |
| commit | 938ffb92da1ea898f661aec04745f7630e2f378c (patch) | |
| tree | 7faeed8433101836cd0239cf6c23629ef1f1289d /addons/website/static/src/js | |
| parent | 1f9e92dfef325b6727e1bee3de55bff095ec6cf2 (diff) | |
| parent | 6466aa499fc37bba5f4feeeecac99448ef88e62e (diff) | |
[MERGE] forward port branch 10.0 up to 6466aa4
Diffstat (limited to 'addons/website/static/src/js')
| -rw-r--r-- | addons/website/static/src/js/website.editor.js | 17 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.snippets.animation.js | 2 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.snippets.editor.js | 11 |
3 files changed, 19 insertions, 11 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 5d2d7706560..a110e6eca3e 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -74,16 +74,17 @@ website.TopBarCustomize = Widget.extend({ key: this.view_name, full: false }).then(function (result) { + var current_group = ""; _.each(result, function (item) { - if (item.header) { - $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); - $menu.append($li); + if (current_group !== item.inherit_id[1]) { + current_group = item.inherit_id[1]; + $menu.append("<li class=\"dropdown-header\">" + current_group + "</li>"); } + 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); + $menu.append($li); }); }); }, diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js index 5d55a25bdb0..572e3a0f0ef 100644 --- a/addons/website/static/src/js/website.snippets.animation.js +++ b/addons/website/static/src/js/website.snippets.animation.js @@ -122,7 +122,7 @@ animation.registry.share = animation.Class.extend({ animation.registry.media_video = animation.Class.extend({ selector: ".media_iframe_video", start: function () { - if (!this.$target.has('.media_iframe_video_size').length) { + if (!this.$target.has('> iframe').length) { var editor = '<div class="css_editable_mode_display"> </div>'; var size = '<div class="media_iframe_video_size"> </div>'; this.$target.html(editor+size+'<iframe src="'+_.escape(this.$target.data("src"))+'" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'); diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index cfd0b561778..4fbb79dd89e 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -311,8 +311,10 @@ options.registry.parallax = options.Class.extend({ this.$target.data("snippet-view", new animation.registry.parallax(this.$target)); } this.scroll(); - this.buildingBlock.$el.on("snippet-dropped snippet-activated", this._refresh.bind(this)); - this.$target.on('snippet-option-change snippet-option-preview', this._refresh.bind(this)); + + this._refresh_callback = this._refresh.bind(this); + this.buildingBlock.$el.on("snippet-dropped snippet-activated", this._refresh_callback); + this.$target.on('snippet-option-change snippet-option-preview', this._refresh_callback); }, scroll: function (type, value) { this.$target.attr("data-scroll-background-ratio", value); @@ -330,6 +332,11 @@ options.registry.parallax = options.Class.extend({ this._super.apply(this, arguments); this._refresh(); }, + on_remove: function () { + this._super.apply(this, arguments); + this.$target.off("snippet-option-change snippet-option-preview", this._refresh_callback); + this.buildingBlock.$el.off("snippet-dropped snippet-activated", this._refresh_callback); + }, }); options.registry.ul = options.Class.extend({ |
