summaryrefslogtreecommitdiff
path: root/addons/website_mass_mailing/static/src
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2019-12-05 14:31:04 +0000
committerqsm-odoo <qsm@odoo.com>2019-12-08 18:03:30 +0000
commit1915fe35984fedac121c8177383735fe0ca6c5d3 (patch)
tree7710d6b15290037802f144865f56619f482b9949 /addons/website_mass_mailing/static/src
parent92fdbec889ec5791b9c4abc949ddeeff8ffecaed (diff)
[IMP] web_editor, *: add new zone in left panel to handle invisible DOM
* website, website_mass_mailing We only have one invisible snippet (newsletter popup) which is handled by adding a yellow alert in the DOM in edit mode to be able to click somewhere to open the snippet options. As we will add some new invisible snippet (generic popup, cookies bar, and probably more) this needed to be improved. Now, any snippet having the `o_snippet_invisible` class will have an entry in the left panel in a dedicated zone to edit itself. This also allows to get rid of the yellow alert, making sure that "what you see is what you get" in the editor zone. task-2150966 closes odoo/odoo#41420 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website_mass_mailing/static/src')
-rw-r--r--addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js
index 526c7e35fec..ca10b5586a0 100644
--- a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js
+++ b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js
@@ -66,11 +66,15 @@ options.registry.newsletter_popup = options.registry.mailing_list_subscribe.exte
*/
start: function () {
var self = this;
- this.$target.on('click.newsletter_popup_option', '.o_edit_popup', function (ev) {
+ this.$target.on('invisible_snippet_activation', function (ev, options) {
// So that the snippet is not enabled again by the editor
ev.stopPropagation();
self.$target.data('quick-open', true);
- self._refreshPublicWidgets();
+ options.onSuccess(new Promise(resolve => {
+ self._refreshPublicWidgets(self.$target, {
+ onSuccess: () => resolve(),
+ });
+ }));
});
this.$target.on('shown.bs.modal.newsletter_popup_option hide.bs.modal.newsletter_popup_option', function () {
self.$target.closest('.o_editable').trigger('content_changed');