mirror of https://github.com/OCA/web.git
[FIX] drag_drop element cannot be seen, if check for undefined value
parent
c9c5fa7cc1
commit
1bf7130978
|
@ -151,18 +151,9 @@ odoo.define("web_drop_target", function (require) {
|
||||||
* @private
|
* @private
|
||||||
* @param {MouseEvent} ev
|
* @param {MouseEvent} ev
|
||||||
*/
|
*/
|
||||||
_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 +164,12 @@ 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 () {
|
||||||
|
@ -186,8 +180,9 @@ odoo.define("web_drop_target", function (require) {
|
||||||
* @private
|
* @private
|
||||||
* @param {MouseEvent} ev
|
* @param {MouseEvent} ev
|
||||||
*/
|
*/
|
||||||
_onBodyFileDrop: function (ev) {
|
_onBodyFileDrop: function(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
if (this._drop_overlay)
|
||||||
this._drop_overlay.addClass("d-none");
|
this._drop_overlay.addClass("d-none");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue