mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_drop_target: Migration to 15.0
This commit is contained in:
@@ -2,13 +2,20 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "Drop target support",
|
||||
"version": "14.0.1.0.1",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "Therp BV,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/web",
|
||||
"license": "AGPL-3",
|
||||
"category": "Usability",
|
||||
"summary": "Allows to drag files into Odoo",
|
||||
"depends": ["web"],
|
||||
"data": ["views/templates.xml"],
|
||||
"qweb": ["static/src/xml/widgets.xml"],
|
||||
"data": [],
|
||||
"assets": {
|
||||
"web.assets_backend": [
|
||||
"web_drop_target/static/lib/base64js.min.js",
|
||||
"web_drop_target/static/src/js/web_drop_target.js",
|
||||
"web_drop_target/static/src/scss/web_drop_target.scss",
|
||||
],
|
||||
"web.assets_qweb": ["web_drop_target/static/src/xml/widgets.xml"],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
odoo.define("web_drop_target", function (require) {
|
||||
"use strict";
|
||||
const ActionManager = require("web.ActionManager");
|
||||
const AbstractAction = require("web.AbstractAction");
|
||||
const FormController = require("web.FormController");
|
||||
const core = require("web.core");
|
||||
const qweb = core.qweb;
|
||||
@@ -152,10 +152,10 @@ odoo.define("web_drop_target", function (require) {
|
||||
*/
|
||||
_onBodyFileDragover: function (ev) {
|
||||
ev.preventDefault();
|
||||
const actionManager = this.findAncestor(function (ancestor) {
|
||||
return ancestor instanceof ActionManager;
|
||||
const abstractAction = this.findAncestor(function (ancestor) {
|
||||
return ancestor instanceof AbstractAction;
|
||||
});
|
||||
const controller = actionManager.currentDialogController;
|
||||
const controller = abstractAction.currentDialogController;
|
||||
if (
|
||||
_.isEmpty(this._get_drop_items(ev)) &&
|
||||
this._checkDragOver() &&
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<template
|
||||
id="assets_backend"
|
||||
name="web_drop_target assets"
|
||||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/web_drop_target/static/lib/base64js.min.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/web_drop_target/static/src/js/web_drop_target.js"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="/web_drop_target/static/src/scss/web_drop_target.scss"
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user