mirror of https://github.com/OCA/web.git
commit
af225121c1
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
odoo.define("web_drop_target", function (require) {
|
odoo.define("web_drop_target", function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
const ActionManager = require("web.ActionManager");
|
|
||||||
const FormController = require("web.FormController");
|
const FormController = require("web.FormController");
|
||||||
const core = require("web.core");
|
const core = require("web.core");
|
||||||
const qweb = core.qweb;
|
const qweb = core.qweb;
|
||||||
|
@ -153,16 +152,7 @@ odoo.define("web_drop_target", function (require) {
|
||||||
*/
|
*/
|
||||||
_onBodyFileDragover: function (ev) {
|
_onBodyFileDragover: function (ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
const actionManager = this.findAncestor(function (ancestor) {
|
if (_.isEmpty(this._get_drop_items(ev)) && this._checkDragOver()) {
|
||||||
return ancestor instanceof ActionManager;
|
|
||||||
});
|
|
||||||
const controller = actionManager.currentDialogController;
|
|
||||||
if (
|
|
||||||
_.isEmpty(this._get_drop_items(ev)) &&
|
|
||||||
this._checkDragOver() &&
|
|
||||||
(controller === undefined ||
|
|
||||||
(controller && controller.jsID === this.controllerID))
|
|
||||||
) {
|
|
||||||
const drop_zone_offset = this.$drop_zone.offset();
|
const drop_zone_offset = this.$drop_zone.offset();
|
||||||
const overlay_css = {
|
const overlay_css = {
|
||||||
top: drop_zone_offset.top,
|
top: drop_zone_offset.top,
|
||||||
|
@ -173,9 +163,11 @@ odoo.define("web_drop_target", function (require) {
|
||||||
if (!this._get_record_id()) {
|
if (!this._get_record_id()) {
|
||||||
overlay_css.background = "#FF000020";
|
overlay_css.background = "#FF000020";
|
||||||
}
|
}
|
||||||
|
if (this._drop_overlay) {
|
||||||
this._drop_overlay.css(overlay_css);
|
this._drop_overlay.css(overlay_css);
|
||||||
this._drop_overlay.removeClass("d-none");
|
this._drop_overlay.removeClass("d-none");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_checkDragOver: function () {
|
_checkDragOver: function () {
|
||||||
|
@ -188,7 +180,7 @@ odoo.define("web_drop_target", function (require) {
|
||||||
*/
|
*/
|
||||||
_onBodyFileDrop: function (ev) {
|
_onBodyFileDrop: function (ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this._drop_overlay.addClass("d-none");
|
if (this._drop_overlay) this._drop_overlay.addClass("d-none");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue