mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2859] fixes for the conditional visibility and disabled states (#3465)
* fixes for the conditional visibility and disabled states * update docs * cleanup code * remove unused code
This commit is contained in:
committed by
Eugenio Romano
parent
1d69f5c407
commit
6f2cbdf697
@@ -132,8 +132,15 @@ export class ContentActionComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.subscriptions.forEach(subscription => subscription.unsubscribe());
|
||||
this.subscriptions = [];
|
||||
|
||||
this.documentActionModel = null;
|
||||
this.folderActionModel = null;
|
||||
if (this.documentActionModel) {
|
||||
this.unregister(this.documentActionModel);
|
||||
this.documentActionModel = null;
|
||||
}
|
||||
|
||||
if (this.folderActionModel) {
|
||||
this.unregister(this.folderActionModel);
|
||||
this.folderActionModel = null;
|
||||
}
|
||||
}
|
||||
|
||||
register(model: ContentActionModel): boolean {
|
||||
@@ -143,6 +150,13 @@ export class ContentActionComponent implements OnInit, OnChanges, OnDestroy {
|
||||
return false;
|
||||
}
|
||||
|
||||
unregister(model: ContentActionModel): boolean {
|
||||
if (this.list) {
|
||||
return this.list.unregisterAction(model);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private generateAction(target: string): ContentActionModel {
|
||||
const model = new ContentActionModel({
|
||||
title: this.title,
|
||||
|
Reference in New Issue
Block a user