summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/common/ace.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-01-07 17:38:11 +0000
committerqsm-odoo <qsm@odoo.com>2019-02-08 14:38:51 +0000
commit10384c689a27aae2101c60b6f3673ecf0810cfdb (patch)
tree0bc72940e19f9a5c68987c916cf4717cce3ec71b /addons/web_editor/static/src/js/common/ace.js
parentff55736c4f5dfa2906c294e1f51489c481b60a84 (diff)
[IMP] website, *: optimize scss customizations
* web_editor This commit's goal is to optimize the delay to make a scss customization thanks to the website customize dialog. Before this commit, the JS code took advantage of existing web_editor routes but this was far from efficient as this was done: 1) PY: Load all scss files used in the page 2) JS: Find the one we want to customize and adapt the scss content 3) PY: Create the scss customization with the new content (So two RPC (including one very slow) and content building in javascript) After this commit, this is done: 1) PY: Load the scss file being customized, adapt its content according to the new values and save the customization (So the whole logic is in python, requiring only one small RPC) This commit also take the opportunity to review the web_editor ace editor loading code (the logic is shared with website customizations). PR https://github.com/odoo/odoo/pull/29624 task-1904244
Diffstat (limited to 'addons/web_editor/static/src/js/common/ace.js')
-rw-r--r--addons/web_editor/static/src/js/common/ace.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/common/ace.js b/addons/web_editor/static/src/js/common/ace.js
index f231bb0aac6..f242129c4a8 100644
--- a/addons/web_editor/static/src/js/common/ace.js
+++ b/addons/web_editor/static/src/js/common/ace.js
@@ -535,7 +535,7 @@ var ViewEditor = Widget.extend({
} else {
var resource = type === 'scss' ? this.scss[resID] : this.js[resID];
return this._rpc({
- route: '/web_editor/reset_scss_or_js',
+ route: '/web_editor/reset_asset',
params: {
url: resID,
bundle_xmlid: resource.bundle_xmlid,
@@ -560,7 +560,7 @@ var ViewEditor = Widget.extend({
var bundleXmlID = sessionIdEndsWithJS ? this.js[session.id].bundle_xmlid : this.scss[session.id].bundle_xmlid;
var fileType = sessionIdEndsWithJS ? 'js' : 'scss';
self._rpc({
- route: '/web_editor/save_scss_or_js',
+ route: '/web_editor/save_asset',
params: {
url: session.id,
bundle_xmlid: bundleXmlID,