summaryrefslogtreecommitdiff
path: root/addons/website_mass_mailing/static
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-05-22 15:30:36 +0200
committerqsm-odoo <qsm@odoo.com>2018-07-27 12:36:54 +0200
commit93b0001df6766fe905ee69c25ec8d846e4551064 (patch)
tree3f88048d24818b6e8871ad6f00308d15f6105f73 /addons/website_mass_mailing/static
parent7822bab880809d7e88c4ce5b45761c97c3244388 (diff)
[REF] *: BS4, adapt forms
The 'form-horizontal' class have been removed; the '.form-group' elements must now use the 'row' class for an horizontal layout. The 'control-label' class was renamed to 'col-form-label'. The 'help-block' class was renamed to 'form-text'. The 'has-error' and 'has-success' classes have been removed and replaced by a new system using the :valid and :invalid pseudo-classes, when a parent has the 'was-validated' class. While this system is great, it is not straightforward to use it in Odoo. Fortunately, BS4 provides the 'is-valid' and 'is-invalid' classes as fallback. This commit replaces the 'has-error' and 'has-success' classes by 'o_has_error' and 'o_has_success' classes (for JS compatibility) and use the 'is-*' fallback classes. (The 'has-warning' class has no equivalent but was unused in Odoo anyway).
Diffstat (limited to 'addons/website_mass_mailing/static')
-rw-r--r--addons/website_mass_mailing/static/src/js/website_mass_mailing.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/website_mass_mailing/static/src/js/website_mass_mailing.js b/addons/website_mass_mailing/static/src/js/website_mass_mailing.js
index 517fe9b75c1..031b795e876 100644
--- a/addons/website_mass_mailing/static/src/js/website_mass_mailing.js
+++ b/addons/website_mass_mailing/static/src/js/website_mass_mailing.js
@@ -43,10 +43,10 @@ sAnimation.registry.subscribe = sAnimation.Class.extend({
var $email = this.$target.find(".js_subscribe_email:visible");
if ($email.length && !$email.val().match(/.+@.+/)) {
- this.$target.addClass('has-error');
+ this.$target.addClass('o_has_error').find('.form-control, .custom-select').addClass('is-invalid');
return false;
}
- this.$target.removeClass('has-error');
+ this.$target.removeClass('o_has_error').find('.form-control, .custom-select').removeClass('is-invalid');
this._rpc({
route: '/website_mass_mailing/subscribe',
@@ -96,10 +96,10 @@ sAnimation.registry.newsletter_popup = sAnimation.Class.extend({
var $email = self.$target.find(".popup_subscribe_email:visible");
if ($email.length && !$email.val().match(/.+@.+/)) {
- this.$target.addClass('has-error');
+ this.$target.addClass('o_has_error').find('.form-control, .custom-select').addClass('is-invalid');
return false;
}
- this.$target.removeClass('has-error');
+ this.$target.removeClass('o_has_error').find('.form-control, .custom-select').removeClass('is-invalid');
this._rpc({
route: '/website_mass_mailing/subscribe',