mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +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
|
||||
*/
|
||||
export class EgwActionObject {
|
||||
readonly id: string
|
||||
id: string
|
||||
readonly parent: EgwActionObject
|
||||
public readonly children: EgwActionObject[] = []
|
||||
private actionLinks: EgwActionLink[] = []
|
||||
@ -111,13 +111,10 @@ export class EgwActionObject {
|
||||
// * @return {egwActionObject} description
|
||||
// * @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) {
|
||||
return this;
|
||||
}
|
||||
if (typeof _search_depth == "undefined") {
|
||||
_search_depth = Number.MAX_VALUE;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.children.length && _search_depth > 0; i++) {
|
||||
const obj = this.children[i].getObjectById(_id, _search_depth - 1);
|
||||
@ -163,7 +160,7 @@ export class EgwActionObject {
|
||||
* @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;
|
||||
|
||||
let obj = null;
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
export interface EgwActionObjectInterface {
|
||||
//properties
|
||||
id?:string
|
||||
_state: number;
|
||||
stateChangeCallback: Function;
|
||||
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
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user