Skip to content

Commit

Permalink
Merge PR OCA#2369 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by etobella
  • Loading branch information
OCA-git-bot committed Nov 10, 2023
2 parents c9c5fa7 + 356bedb commit af22512
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions web_drop_target/static/src/js/web_drop_target.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

odoo.define("web_drop_target", function (require) {
"use strict";
const ActionManager = require("web.ActionManager");
const FormController = require("web.FormController");
const core = require("web.core");
const qweb = core.qweb;
Expand Down Expand Up @@ -153,16 +152,7 @@ odoo.define("web_drop_target", function (require) {
*/
_onBodyFileDragover: function (ev) {
ev.preventDefault();
const actionManager = this.findAncestor(function (ancestor) {
return ancestor instanceof ActionManager;
});
const controller = actionManager.currentDialogController;
if (
_.isEmpty(this._get_drop_items(ev)) &&
this._checkDragOver() &&
(controller === undefined ||
(controller && controller.jsID === this.controllerID))
) {
if (_.isEmpty(this._get_drop_items(ev)) && this._checkDragOver()) {
const drop_zone_offset = this.$drop_zone.offset();
const overlay_css = {
top: drop_zone_offset.top,
Expand All @@ -173,8 +163,10 @@ odoo.define("web_drop_target", function (require) {
if (!this._get_record_id()) {
overlay_css.background = "#FF000020";
}
this._drop_overlay.css(overlay_css);
this._drop_overlay.removeClass("d-none");
if (this._drop_overlay) {
this._drop_overlay.css(overlay_css);
this._drop_overlay.removeClass("d-none");
}
}
},

Expand All @@ -188,7 +180,7 @@ odoo.define("web_drop_target", function (require) {
*/
_onBodyFileDrop: function (ev) {
ev.preventDefault();
this._drop_overlay.addClass("d-none");
if (this._drop_overlay) this._drop_overlay.addClass("d-none");
},

/**
Expand Down

0 comments on commit af22512

Please sign in to comment.