summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.theme.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-02-24 13:13:12 +0100
committerqsm-odoo <qsm@odoo.com>2016-02-24 13:47:36 +0100
commit6610d05549e347fbb548e606fa66cfb113df9e67 (patch)
treefc750ca544b5caa135791c0eaeb10dfee17eefa3 /addons/website/static/src/js/website.theme.js
parent58c5ff1d4f64f16d43106e6b00f0b94fe63506c2 (diff)
[REF] web_editor,website,mass_mailing: JS/XML update
* Adapt DOM selectors * Refactore dialog XMLs to have odoo styling * New editor options (background-position, ...) * Various improvements
Diffstat (limited to 'addons/website/static/src/js/website.theme.js')
-rw-r--r--addons/website/static/src/js/website.theme.js36
1 files changed, 14 insertions, 22 deletions
diff --git a/addons/website/static/src/js/website.theme.js b/addons/website/static/src/js/website.theme.js
index b392f27dc5b..6b4fd81c7ae 100644
--- a/addons/website/static/src/js/website.theme.js
+++ b/addons/website/static/src/js/website.theme.js
@@ -45,7 +45,6 @@ var Theme = Widget.extend({
this.timer = null;
this.reload = false;
this.flag = false;
- this.$el.addClass("theme_customize_modal");
this.active_select_tags();
this.$inputs = this.$("input[data-xmlid],input[data-enable],input[data-disable]");
setTimeout(function () {self.$el.addClass('in');}, 0);
@@ -95,20 +94,20 @@ var Theme = Widget.extend({
var self = this;
$('#theme_error').remove();
return ajax.jsonRpc('/website/theme_customize_get', 'call', {
- 'xml_ids': this.get_xml_ids(this.$inputs)
- }).done(function (data) {
- self.$inputs.filter('[data-xmlid=""]').prop("checked", true).change();
- self.$inputs.filter('[data-xmlid]:not([data-xmlid=""])').each(function () {
- if (!_.difference(self.get_xml_ids($(this)), data[1]).length) {
- $(this).prop("checked", false).trigger("change", true);
- }
- if (!_.difference(self.get_xml_ids($(this)), data[0]).length) {
- $(this).prop("checked", true).trigger("change", true);
- }
- });
- }).fail(function (d, error) {
- $('body').prepend($('<div id="theme_error"/>').text(error.data.message));
+ 'xml_ids': this.get_xml_ids(this.$inputs)
+ }).done(function (data) {
+ self.$inputs.filter('[data-xmlid=""]').prop("checked", true).change();
+ self.$inputs.filter('[data-xmlid]:not([data-xmlid=""])').each(function () {
+ if (!_.difference(self.get_xml_ids($(this)), data[1]).length) {
+ $(this).prop("checked", false).trigger("change", true);
+ }
+ if (!_.difference(self.get_xml_ids($(this)), data[0]).length) {
+ $(this).prop("checked", true).trigger("change", true);
+ }
});
+ }).fail(function (d, error) {
+ $('body').prepend($('<div id="theme_error"/>').text(error.data.message));
+ });
},
get_inputs: function (string) {
return this.$inputs.filter('#'+string.split(/\s*,\s*/).join(", #"));
@@ -278,14 +277,7 @@ function themeError(message) {
message = '<span class="text-muted">' + message + "</span><br/><br/>" + _t("Please install or update node-less");
}
- var $error = $( QWeb.render('website.error_dialog', {
- title: _t("Theme Error"),
- message: message
- }));
- $error.appendTo("body").modal();
- $error.on('hidden.bs.modal', function () {
- $(this).remove();
- });
+ website.error(_t("Theme Error"), message);
}
function theme_customize() {