summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-08-22 13:38:17 +0200
committerqsm-odoo <qsm@odoo.com>2018-08-22 16:11:48 +0200
commitc35cc4296a42a67c59994a31925eedd3a28353da (patch)
tree362abe072e5e9848f913181b5527610125967846 /addons/web_editor/static/src
parent559ce05186f382e3c46bc592d3042018c987b08a (diff)
[REF] web_editor: review some dropzone code
- Remove useless code - Make searching for the nearest dropzone more efficient
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js8
-rw-r--r--addons/web_editor/static/src/scss/web_editor.ui.scss2
2 files changed, 4 insertions, 6 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js
index 87b8f0ced0b..ffade19c731 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -1239,10 +1239,10 @@ var SnippetsMenu = Widget.extend({
stop: function (ev, ui) {
$toInsert.removeClass('oe_snippet_body');
- if (! dropped && self.$editable.find('.oe_drop_zone') && ui.position.top > 3 && ui.position.left + 50 > self.$el.outerWidth()) {
- var el = self.$editable.find('.oe_drop_zone').nearest({x: ui.position.left, y: ui.position.top}).first();
- if (el.length) {
- el.after($toInsert);
+ if (!dropped && ui.position.top > 3 && ui.position.left + 50 > self.$el.outerWidth()) {
+ var $el = $.nearest({x: ui.position.left, y: ui.position.top}, '.oe_drop_zone').first();
+ if ($el.length) {
+ $el.after($toInsert);
dropped = true;
}
}
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 d2fefe9f23a..c6204c6bab3 100644
--- a/addons/web_editor/static/src/scss/web_editor.ui.scss
+++ b/addons/web_editor/static/src/scss/web_editor.ui.scss
@@ -270,8 +270,6 @@ html[lang] > body.editor_enable [data-oe-translation-state] {
height: $o-we-dropzone-size;
margin: (-$o-we-dropzone-size/2) 0;
- transition: margin 400ms linear 0s;
-
&:after {
content: "";
display: block;