summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-07-05 13:17:59 +0200
committerQuentin Smetz (qsm) <qsm@odoo.com>2018-07-09 11:59:30 +0200
commit2c966909e2c0b5e45912a6ff85577f0b19a5f4c9 (patch)
tree71d294f0a0577c13561bf079aa58fd2395653f11 /addons/web_editor/static/src/js
parent49a905321a5b94df6d87355c57c4c1a02d349502 (diff)
[FIX] *: fix some side-effects of https://github.com/odoo/odoo/commit/9de1bc0eef6f5bfaa2a8d745431caa361ae91548
- JS Modals were not correctly built anymore, their .modal-body element was duplicated and many without-effect JS lines were introduced (as a side effect, the form view design was broken when inside modals) - Tests were changed to make bugs go unnoticed. For example, the media dialog functionnality was entirely broken because the .modal-dialog element was not receiving the correct class anymore. - The JS translation function is _t, not _ - Do not use the <title/> tag as a regular DOM element, it is meant to be unique, in the <head/> section - CSS rules were added to the utils.scss file, which is meant to contain functions and mixins, otherwise, the rule is duplicated in every asset - Some icons were still broken, as missed by https://github.com/odoo/odoo/commit/f90cf060a3cfeb37a67bec83264c0aaab8892b56 - Tests were changed to use [role="dialog"]/footer/header in their selectors without any reason, this commit restores some of that to avoid rebase conflicts with the BS4 work. - ... Note: other elements should still be discussed, like the direct use of the 'o_form_label' class in views definition... but those do not cause direct problems.
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/backend/fields.js2
-rw-r--r--addons/web_editor/static/src/js/tours/rte.js6
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js2
3 files changed, 5 insertions, 5 deletions
diff --git a/addons/web_editor/static/src/js/backend/fields.js b/addons/web_editor/static/src/js/backend/fields.js
index 00c84c5fe92..a636b7e5be3 100644
--- a/addons/web_editor/static/src/js/backend/fields.js
+++ b/addons/web_editor/static/src/js/backend/fields.js
@@ -400,7 +400,7 @@ var FieldTextHtml = AbstractField.extend({
return src;
},
old_initialize_content: function () {
- this.$el.closest('main.modal-body').css('max-height', 'none');
+ this.$el.closest('.modal-body').css('max-height', 'none');
this.$iframe = this.$el.find('iframe');
this.document = null;
this.$body = $();
diff --git a/addons/web_editor/static/src/js/tours/rte.js b/addons/web_editor/static/src/js/tours/rte.js
index 6d686353cfb..82c31da5259 100644
--- a/addons/web_editor/static/src/js/tours/rte.js
+++ b/addons/web_editor/static/src/js/tours/rte.js
@@ -157,7 +157,7 @@ tour.register('rte', {
trigger: '#editor-media-icon.active span.fa:first',
}, {
content: "save pictogram",
- trigger: 'footer.modal-footer .btn-primary',
+ trigger: '.modal-footer > .btn-primary',
extra_trigger: '#editor-media-icon.active span.o_selected',
}, {
content: "select a size for the pictogram",
@@ -180,7 +180,7 @@ tour.register('rte', {
extra_trigger: 'a#link-preview:containsRegex(/^<span [^>]+><\\/span>$/) > span.fa.fa-3x.pull-right',
}, {
content: "save link",
- trigger: 'footer.modal-footer .btn-primary',
+ trigger: '.modal-footer > .btn-primary',
extra_trigger: 'a#link-preview.btn.btn-success span.fa.fa-3x.pull-right',
}, {
content: "click on other picture",
@@ -200,7 +200,7 @@ tour.register('rte', {
extra_trigger: 'a#link-preview:containsRegex(/^<img [^>]+>$/) img',
}, {
content: "save link",
- trigger: 'footer.modal-footer .btn-primary',
+ trigger: '.modal-footer > .btn-primary',
extra_trigger: 'a#link-preview.btn.btn-success[href="mailto:test@test.test"]:containsRegex(/^<img [^>]+>$/) img',
}, {
content: "select for triple enter then double backspace",
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js
index e6c15aeb4ff..e2dc7ea73a7 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -1171,7 +1171,7 @@ var MediaDialog = Dialog.extend({
var self = this;
var defs = [this._super.apply(this, arguments)];
this.$modal.addClass('note-image-dialog');
- this.$modal.find('[role="dialog"]').addClass('o_select_media_dialog');
+ this.$modal.find('.modal-dialog').addClass('o_select_media_dialog');
if (this.imageDialog) {
defs.push(this.imageDialog.appendTo(this.$("#editor-media-image")));