mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Customisation of global actions (folders and documents)
- support for registering custom global actions (folders, documents) - documentation update with code samples and pictures refs #9
This commit is contained in:
@@ -24,12 +24,23 @@ export class FolderActionsService {
|
||||
|
||||
constructor() {
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.handlers['system1'] = this.handleStandardAction1;
|
||||
this.handlers['system2'] = this.handleStandardAction2;
|
||||
this.handlers['system1'] = this.handleStandardAction1.bind(this);
|
||||
this.handlers['system2'] = this.handleStandardAction2.bind(this);
|
||||
}
|
||||
|
||||
getHandler(key: string): ContentActionHandler {
|
||||
return this.handlers[key];
|
||||
if (key) {
|
||||
let lkey = key.toLowerCase();
|
||||
return this.handlers[lkey];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
setHandler(key: string, handler: ContentActionHandler): void {
|
||||
if (key) {
|
||||
let lkey = key.toLowerCase();
|
||||
this.handlers[lkey] = handler;
|
||||
}
|
||||
}
|
||||
|
||||
private handleStandardAction1(document: any) {
|
||||
|
Reference in New Issue
Block a user