mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 01:29:05 +01:00
EgwAction changes to suit Sl-Tree
This commit is contained in:
parent
da195d2029
commit
96760511ea
@ -48,7 +48,7 @@ import {egwActionObjectInterface} from "./egw_action";
|
|||||||
* defaults to 0
|
* defaults to 0
|
||||||
*/
|
*/
|
||||||
export class EgwActionObject {
|
export class EgwActionObject {
|
||||||
readonly id: string
|
id: string
|
||||||
readonly parent: EgwActionObject
|
readonly parent: EgwActionObject
|
||||||
public readonly children: EgwActionObject[] = []
|
public readonly children: EgwActionObject[] = []
|
||||||
private actionLinks: EgwActionLink[] = []
|
private actionLinks: EgwActionLink[] = []
|
||||||
@ -111,13 +111,10 @@ export class EgwActionObject {
|
|||||||
// * @return {egwActionObject} description
|
// * @return {egwActionObject} description
|
||||||
// * @todo Add search function to egw_action_commons.js
|
// * @todo Add search function to egw_action_commons.js
|
||||||
// */
|
// */
|
||||||
getObjectById(_id, _search_depth) {
|
getObjectById(_id, _search_depth=Number.MAX_VALUE):EgwActionObject {
|
||||||
if (this.id == _id) {
|
if (this.id == _id) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if (typeof _search_depth == "undefined") {
|
|
||||||
_search_depth = Number.MAX_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < this.children.length && _search_depth > 0; i++) {
|
for (let i = 0; i < this.children.length && _search_depth > 0; i++) {
|
||||||
const obj = this.children[i].getObjectById(_id, _search_depth - 1);
|
const obj = this.children[i].getObjectById(_id, _search_depth - 1);
|
||||||
@ -163,7 +160,7 @@ export class EgwActionObject {
|
|||||||
* @returns object the generated object
|
* @returns object the generated object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
insertObject(_index: number | boolean, _id: string | EgwActionObject, _iface: EgwActionObjectInterface, _flags: number) {
|
insertObject(_index: number | boolean, _id: string | EgwActionObject, _iface?: EgwActionObjectInterface, _flags?: number) {
|
||||||
if (_index === false) _index = this.children.length;
|
if (_index === false) _index = this.children.length;
|
||||||
|
|
||||||
let obj = null;
|
let obj = null;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
export interface EgwActionObjectInterface {
|
export interface EgwActionObjectInterface {
|
||||||
//properties
|
//properties
|
||||||
|
id?:string
|
||||||
_state: number;
|
_state: number;
|
||||||
stateChangeCallback: Function;
|
stateChangeCallback: Function;
|
||||||
stateChangeContext: any;
|
stateChangeContext: any;
|
||||||
|
@ -105,7 +105,7 @@ export function egw_getObjectManager(_id, _create = true, _search_depth = Number
|
|||||||
* @param {string} _appName //appName might not always be the current app, e.g. running app content under admin tab
|
* @param {string} _appName //appName might not always be the current app, e.g. running app content under admin tab
|
||||||
* @return {EgwActionObjectManager}
|
* @return {EgwActionObjectManager}
|
||||||
*/
|
*/
|
||||||
export function egw_getAppObjectManager(_create, _appName = "") {
|
export function egw_getAppObjectManager(_create = true, _appName = "") {
|
||||||
return egw_getObjectManager(_appName ? _appName : window.egw(window).app_name(), _create, 1);
|
return egw_getObjectManager(_appName ? _appName : window.egw(window).app_name(), _create, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user