diff --git a/api/js/egw_action/egw_dragdrop_dhtmlx_tree.js b/api/js/egw_action/egw_dragdrop_dhtmlx_tree.js index f6d14ae61c..32ce725600 100644 --- a/api/js/egw_action/egw_dragdrop_dhtmlx_tree.js +++ b/api/js/egw_action/egw_dragdrop_dhtmlx_tree.js @@ -1,25 +1,27 @@ /** - * eGroupWare egw_dragdrop_dhtmlxmenu - egw action framework + * EGroupware egw_dragdrop_dhtmlxmenu - egw action framework * - * @link http://www.egroupware.org + * @link https://www.egroupware.org * @author Andreas Stöckel * @copyright 2011 by Andreas Stöckel * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package egw_action - * @version $Id$ */ /*egw:uses egw_action; */ +import {EGW_AO_STATE_FOCUSED, EGW_AO_STATE_SELECTED, egwActionObjectInterface, EGW_AI_DRAG_OVER, EGW_AI_DRAG_OUT} from "./egw_action"; +import {egwBitIsSet} from "./egw_action_common"; + /** * This file contains an egw_actionObjectInterface which allows a dhtmlx tree * row to be a drag target and contains a function which transforms a complete * dhtmlx tree into egw_actionObjects */ -function dhtmlxTree_getNode(_tree, _itemId) { +export function dhtmlxTree_getNode(_tree, _itemId) { var node = _tree._globalIdStorageFind(_itemId); if (node != null) { @@ -31,7 +33,7 @@ function dhtmlxTree_getNode(_tree, _itemId) { // An action object interface for an dhtmlxTree entry - it only contains the // code needed for drag/drop handling -function dhtmlxtreeItemAOI(_tree, _itemId) +export function dhtmlxtreeItemAOI(_tree, _itemId) { var aoi = new egwActionObjectInterface(); diff --git a/api/js/etemplate/et2_widget_tree.js b/api/js/etemplate/et2_widget_tree.js index a17104c99e..c10fc035ad 100644 --- a/api/js/etemplate/et2_widget_tree.js +++ b/api/js/etemplate/et2_widget_tree.js @@ -25,7 +25,8 @@ import { ClassWithAttributes } from "./et2_core_inheritance"; import { et2_no_init } from "./et2_core_common"; import { egw, framework } from "../jsapi/egw_global"; import { EGW_AO_FLAG_IS_CONTAINER, egw_getAppObjectManager, egw_getObjectManager, egwActionObject } from "../egw_action/egw_action.js"; -import { egwIsMobile } from "../egw_action/egw_action_common"; +import { dhtmlxtreeItemAOI } from "../egw_action/egw_dragdrop_dhtmlx_tree.js"; +import { egwIsMobile } from "../egw_action/egw_action_common.js"; /* no module, but egw:uses is ignored, so adding it here commented out import '../../../api/js/dhtmlxtree/sources/dhtmlxtree.js'; import '../../../api/js/dhtmlxtree/sources/ext/dhtmlxtree_json.js'; diff --git a/api/js/etemplate/et2_widget_tree.ts b/api/js/etemplate/et2_widget_tree.ts index d329c4ca6f..7fa117355f 100644 --- a/api/js/etemplate/et2_widget_tree.ts +++ b/api/js/etemplate/et2_widget_tree.ts @@ -27,7 +27,8 @@ import {ClassWithAttributes} from "./et2_core_inheritance"; import {et2_no_init} from "./et2_core_common"; import {egw, framework} from "../jsapi/egw_global"; import {EGW_AO_FLAG_IS_CONTAINER, egw_getAppObjectManager, egw_getObjectManager, egwActionObject} from "../egw_action/egw_action.js"; -import {egwIsMobile} from "../egw_action/egw_action_common"; +import {dhtmlxtreeItemAOI} from "../egw_action/egw_dragdrop_dhtmlx_tree.js"; +import {egwIsMobile} from "../egw_action/egw_action_common.js"; /* no module, but egw:uses is ignored, so adding it here commented out import '../../../api/js/dhtmlxtree/sources/dhtmlxtree.js'; diff --git a/api/js/etemplate/etemplate2.js b/api/js/etemplate/etemplate2.js index 463187f784..500a6a7d50 100644 --- a/api/js/etemplate/etemplate2.js +++ b/api/js/etemplate/etemplate2.js @@ -18,6 +18,7 @@ import { et2_compileLegacyJS } from "./et2_core_legacyJSFunctions"; import { et2_loadXMLFromURL } from "./et2_core_xml"; import { et2_nextmatch, et2_nextmatch_header_bar } from "./et2_extension_nextmatch"; import '../jsapi/egw_json.js'; +import { egwIsMobile } from "../egw_action/egw_action_common"; /* Include all widget classes here, we only care about them registering, not importing anything import './et2_widget_template'; import './et2_widget_grid'; @@ -375,12 +376,14 @@ export class etemplate2 { var start_time = (new Date).getTime(); } // require necessary translations from server AND the app.js file, if not already loaded - if (!jQuery.isArray(_data.langRequire)) - _data.langRequire = []; - Promise.all([ - egw(currentapp, window).langRequire(window, _data.langRequire), - egw(currentapp, window).includeJS('/' + appname + '/js/app.js', undefined, undefined, egw.webserverUrl) - ]).catch((err) => { + let promisses = []; + if (Array.isArray(_data.langRequire)) { + promisses.push(egw(currentapp, window).langRequire(window, _data.langRequire)); + } + if (appname) { + promisses.push(egw(currentapp, window).includeJS('/' + appname + '/js/app.js', undefined, undefined, egw.webserverUrl)); + } + Promise.all(promisses).catch((err) => { console.log("et2.load(): error loading lang-files and app.js: " + err.message); }).then(() => { this.clear(); diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index 79c6b013d8..f0af49f404 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -85,6 +85,7 @@ import {et2_loadXMLFromURL} from "./et2_core_xml"; import {et2_nextmatch, et2_nextmatch_header_bar} from "./et2_extension_nextmatch"; import {et2_tabbox} from "./et2_widget_tabs"; import '../jsapi/egw_json.js'; +import {egwIsMobile} from "../egw_action/egw_action_common"; /* Include all widget classes here, we only care about them registering, not importing anything import './et2_widget_template'; @@ -564,11 +565,14 @@ export class etemplate2 } // require necessary translations from server AND the app.js file, if not already loaded - if (!jQuery.isArray(_data.langRequire)) _data.langRequire = []; - Promise.all([ - egw(currentapp, window).langRequire(window, _data.langRequire), - egw(currentapp, window).includeJS('/'+appname+'/js/app.js', undefined, undefined, egw.webserverUrl) - ]).catch((err) => { + let promisses = []; + if (Array.isArray(_data.langRequire)) { + promisses.push(egw(currentapp, window).langRequire(window, _data.langRequire)); + } + if (appname) { + promisses.push(egw(currentapp, window).includeJS('/'+appname+'/js/app.js', undefined, undefined, egw.webserverUrl)); + } + Promise.all(promisses).catch((err) => { console.log("et2.load(): error loading lang-files and app.js: "+err.message); }).then(() => { this.clear();