summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-01-31 16:59:58 +0100
committerChristophe Simonis <chs@odoo.com>2019-01-31 16:59:58 +0100
commitf927c68ddbe4dccbdd0174019d6028d30b0d8058 (patch)
treeaf24ebffe8241ee0c6ec9c911f2fe15f54237bcc /addons/web_editor/static/src
parent24ba5ae276a7c25cdcd4d2db2e17e032cfa7e52a (diff)
parentcb8fefa8999bd0056c2191edbdbbb85918d221da (diff)
[MERGE] forward port branch 12.0 up to cb8fefa8999
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/widgets/ace.js13
-rw-r--r--addons/web_editor/static/src/scss/web_editor.ui.scss5
2 files changed, 14 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/widgets/ace.js b/addons/web_editor/static/src/js/widgets/ace.js
index f3c47f30050..37c21f2aa36 100644
--- a/addons/web_editor/static/src/js/widgets/ace.js
+++ b/addons/web_editor/static/src/js/widgets/ace.js
@@ -2,6 +2,7 @@ odoo.define('web_editor.ace', function (require) {
'use strict';
var ajax = require('web.ajax');
+var concurrency = require('web.concurrency');
var core = require('web.core');
var Dialog = require('web.Dialog');
var Widget = require('web.Widget');
@@ -359,7 +360,7 @@ var ViewEditor = Widget.extend({
this.aceEditor.setSession(editingSession);
if (this.currentType === 'xml') {
- this.$viewID.text(_.str.sprintf(_t("Template ID: %s"), this.views[resID].xml_id));
+ this.$viewID.text(_.str.sprintf(_t("Template ID: %s"), this.views[resID].key));
} else {
this.$viewID.text(_.str.sprintf(_t("SCSS file: %s"), resID));
}
@@ -536,6 +537,7 @@ var ViewEditor = Widget.extend({
* error occured.
*/
_saveResources: function () {
+ var self = this;
var toSave = {};
var errorFound = false;
_.each(this.editingSessions, (function (editingSessions, type) {
@@ -563,8 +565,15 @@ var ViewEditor = Widget.extend({
if (errorFound) return $.Deferred().reject(errorFound);
var defs = [];
+ var mutex = new concurrency.Mutex();
_.each(toSave, (function (_toSave, type) {
- defs = defs.concat(_.map(_toSave, (type === 'xml' ? this._saveView : this._saveSCSS).bind(this)));
+ // Child views first as COW on a parent would delete them
+ _toSave = _.sortBy(_toSave, 'id').reverse();
+ _.each(_toSave, function (session) {
+ defs.push(mutex.exec(function () {
+ return (type === 'xml' ? self._saveView(session) : self._saveSCSS(session));
+ }));
+ });
}).bind(this));
return $.when.apply($, defs).fail((function (session, error) {
diff --git a/addons/web_editor/static/src/scss/web_editor.ui.scss b/addons/web_editor/static/src/scss/web_editor.ui.scss
index 06e56ee657f..e615b3b5e38 100644
--- a/addons/web_editor/static/src/scss/web_editor.ui.scss
+++ b/addons/web_editor/static/src/scss/web_editor.ui.scss
@@ -1064,10 +1064,11 @@ body.editor_enable {
box-shadow: inset 0 0 0px 1px darken($o-we-switch-inactive-color,10%);
border-radius: 100rem;
height: $o-we-switch-size;
- width: $o-we-switch-size * 1.8;
- margin-right: 0.5em;
+ width: $o-we-switch-size * 1.81;
+ margin-right: 0.51em;
display: inline-block;
transition: all 0.3s $o-we-md-ease;
+ font-size: 15px;
&:after {
content: "";