mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
got tree-actions in admin working and fixed tutorials (et2.load() stalled if no app.js or lang-files)
This commit is contained in:
parent
31c7b87faa
commit
77a4aad7d6
@ -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 <as@stylite.de>
|
* @author Andreas Stöckel <as@stylite.de>
|
||||||
* @copyright 2011 by Andreas Stöckel
|
* @copyright 2011 by Andreas Stöckel
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
* @package egw_action
|
* @package egw_action
|
||||||
* @version $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*egw:uses
|
/*egw:uses
|
||||||
egw_action;
|
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
|
* 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
|
* row to be a drag target and contains a function which transforms a complete
|
||||||
* dhtmlx tree into egw_actionObjects
|
* dhtmlx tree into egw_actionObjects
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function dhtmlxTree_getNode(_tree, _itemId) {
|
export function dhtmlxTree_getNode(_tree, _itemId) {
|
||||||
var node = _tree._globalIdStorageFind(_itemId);
|
var node = _tree._globalIdStorageFind(_itemId);
|
||||||
if (node != null)
|
if (node != null)
|
||||||
{
|
{
|
||||||
@ -31,7 +33,7 @@ function dhtmlxTree_getNode(_tree, _itemId) {
|
|||||||
|
|
||||||
// An action object interface for an dhtmlxTree entry - it only contains the
|
// An action object interface for an dhtmlxTree entry - it only contains the
|
||||||
// code needed for drag/drop handling
|
// code needed for drag/drop handling
|
||||||
function dhtmlxtreeItemAOI(_tree, _itemId)
|
export function dhtmlxtreeItemAOI(_tree, _itemId)
|
||||||
{
|
{
|
||||||
var aoi = new egwActionObjectInterface();
|
var aoi = new egwActionObjectInterface();
|
||||||
|
|
||||||
|
@ -25,7 +25,8 @@ import { ClassWithAttributes } from "./et2_core_inheritance";
|
|||||||
import { et2_no_init } from "./et2_core_common";
|
import { et2_no_init } from "./et2_core_common";
|
||||||
import { egw, framework } from "../jsapi/egw_global";
|
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 { 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
|
/* 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/dhtmlxtree.js';
|
||||||
import '../../../api/js/dhtmlxtree/sources/ext/dhtmlxtree_json.js';
|
import '../../../api/js/dhtmlxtree/sources/ext/dhtmlxtree_json.js';
|
||||||
|
@ -27,7 +27,8 @@ import {ClassWithAttributes} from "./et2_core_inheritance";
|
|||||||
import {et2_no_init} from "./et2_core_common";
|
import {et2_no_init} from "./et2_core_common";
|
||||||
import {egw, framework} from "../jsapi/egw_global";
|
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 {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
|
/* 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/dhtmlxtree.js';
|
||||||
|
@ -18,6 +18,7 @@ import { et2_compileLegacyJS } from "./et2_core_legacyJSFunctions";
|
|||||||
import { et2_loadXMLFromURL } from "./et2_core_xml";
|
import { et2_loadXMLFromURL } from "./et2_core_xml";
|
||||||
import { et2_nextmatch, et2_nextmatch_header_bar } from "./et2_extension_nextmatch";
|
import { et2_nextmatch, et2_nextmatch_header_bar } from "./et2_extension_nextmatch";
|
||||||
import '../jsapi/egw_json.js';
|
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
|
/* Include all widget classes here, we only care about them registering, not importing anything
|
||||||
import './et2_widget_template';
|
import './et2_widget_template';
|
||||||
import './et2_widget_grid';
|
import './et2_widget_grid';
|
||||||
@ -375,12 +376,14 @@ export class etemplate2 {
|
|||||||
var start_time = (new Date).getTime();
|
var start_time = (new Date).getTime();
|
||||||
}
|
}
|
||||||
// require necessary translations from server AND the app.js file, if not already loaded
|
// require necessary translations from server AND the app.js file, if not already loaded
|
||||||
if (!jQuery.isArray(_data.langRequire))
|
let promisses = [];
|
||||||
_data.langRequire = [];
|
if (Array.isArray(_data.langRequire)) {
|
||||||
Promise.all([
|
promisses.push(egw(currentapp, window).langRequire(window, _data.langRequire));
|
||||||
egw(currentapp, window).langRequire(window, _data.langRequire),
|
}
|
||||||
egw(currentapp, window).includeJS('/' + appname + '/js/app.js', undefined, undefined, egw.webserverUrl)
|
if (appname) {
|
||||||
]).catch((err) => {
|
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);
|
console.log("et2.load(): error loading lang-files and app.js: " + err.message);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.clear();
|
this.clear();
|
||||||
|
@ -85,6 +85,7 @@ import {et2_loadXMLFromURL} from "./et2_core_xml";
|
|||||||
import {et2_nextmatch, et2_nextmatch_header_bar} from "./et2_extension_nextmatch";
|
import {et2_nextmatch, et2_nextmatch_header_bar} from "./et2_extension_nextmatch";
|
||||||
import {et2_tabbox} from "./et2_widget_tabs";
|
import {et2_tabbox} from "./et2_widget_tabs";
|
||||||
import '../jsapi/egw_json.js';
|
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
|
/* Include all widget classes here, we only care about them registering, not importing anything
|
||||||
import './et2_widget_template';
|
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
|
// require necessary translations from server AND the app.js file, if not already loaded
|
||||||
if (!jQuery.isArray(_data.langRequire)) _data.langRequire = [];
|
let promisses = [];
|
||||||
Promise.all([
|
if (Array.isArray(_data.langRequire)) {
|
||||||
egw(currentapp, window).langRequire(window, _data.langRequire),
|
promisses.push(egw(currentapp, window).langRequire(window, _data.langRequire));
|
||||||
egw(currentapp, window).includeJS('/'+appname+'/js/app.js', undefined, undefined, egw.webserverUrl)
|
}
|
||||||
]).catch((err) => {
|
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);
|
console.log("et2.load(): error loading lang-files and app.js: "+err.message);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.clear();
|
this.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user