[FIX] web_editor, *: expose access to all snippet options UI
* website_form To support old theme options, a hack had to be made to allow access to left panel UI. This will be improved in master. Part of https://github.com/odoo/odoo/pull/38495 task-2083198 X-original-commit: 5ac6a7a5dbd2af1190d0d027d0239dd1cfc257b0
This commit is contained in:
@@ -359,6 +359,10 @@ var SnippetEditor = Widget.extend({
|
||||
$optionsSection.on('click', '.oe_snippet_remove', this._onRemoveClick.bind(this));
|
||||
this._customize$Elements.push($optionsSection);
|
||||
|
||||
// TODO get rid of this when possible (made as a fix to support old
|
||||
// theme options)
|
||||
this.$el.data('$optionsSection', $optionsSection);
|
||||
|
||||
var i = 0;
|
||||
var defs = _.map(this.templateOptions, val => {
|
||||
if (!val.selector.is(this.$target)) {
|
||||
|
||||
@@ -530,8 +530,8 @@ odoo.define('website_form_editor', function (require) {
|
||||
disable_button: function (button_name, message) {
|
||||
// TODO refactor in master
|
||||
var className = 'oe_snippet_' + button_name;
|
||||
this.$overlay.on('click', '.' + className, this.prevent_button);
|
||||
var $button = this.$overlay.find('.' + className);
|
||||
this.$overlay.add(this.$overlay.data('$optionsSection')).on('click', '.' + className, this.prevent_button);
|
||||
var $button = this.$overlay.add(this.$overlay.data('$optionsSection')).find('.' + className);
|
||||
$button.attr('title', message).tooltip({delay: 0});
|
||||
$button.removeClass(className); // Disable the functionnality
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user