diff options
| author | Christophe Matthieu <chm@odoo.com> | 2014-08-21 18:00:23 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2014-08-21 18:02:14 +0200 |
| commit | 239b6bc0b5a2a644486737f2b0b71e7e6c0a2edf (patch) | |
| tree | b53f6f30cba0149ae9a41d25901ac301c3bbf775 /addons/website_mail_group/static/src/js | |
| parent | b7beb69e03e14e111d07899c23b82b993ca8a972 (diff) | |
[IMP] website snippet new option, gallery
website.snippet: The methods described in javascript will be called automatically from the data-method_name = value on li snippets options. The methods are called in the order relative to children of xml (eg: <li data-method1=value1> ... <li data-method2=value2> ... </ li>, the method1 is then called method2). Methods receive two arguments: type (over, click, reset) and value. data-snippet-id-option becomes data-snippet-id. Several xml options can use the same data-snippet-id.
add a new gallery snippet
convert website_sale to the new option system
Diffstat (limited to 'addons/website_mail_group/static/src/js')
| -rw-r--r-- | addons/website_mail_group/static/src/js/website_mail_group.editor.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/addons/website_mail_group/static/src/js/website_mail_group.editor.js b/addons/website_mail_group/static/src/js/website_mail_group.editor.js index fdfb948121f..420afb736af 100644 --- a/addons/website_mail_group/static/src/js/website_mail_group.editor.js +++ b/addons/website_mail_group/static/src/js/website_mail_group.editor.js @@ -5,8 +5,9 @@ var _t = openerp._t; website.snippet.options.subscribe = website.snippet.Option.extend({ - on_prompt: function () { + choose_mailing_list: function (type, value) { var self = this; + if (type !== "click") return; return website.prompt({ id: "editor_new_subscribe_button", window_title: _t("Add a Subscribe Button"), @@ -22,15 +23,10 @@ drop_and_build_snippet: function() { var self = this; this._super(); - this.on_prompt().fail(function () { + this.choose_mailing_list("click").fail(function () { self.editor.on_remove(); }); }, - start : function () { - var self = this; - this.$el.find(".js_mailing_list").on("click", _.bind(this.on_prompt, this)); - this._super(); - }, clean_for_save: function () { this.$target.addClass("hidden"); }, |
