Greatly reduced markup for document/folder actions

refs #20, #9
This commit is contained in:
Denys Vuika
2016-05-04 13:06:10 +01:00
parent 548fb14f4c
commit eb5c7d7aae
47 changed files with 192 additions and 1065 deletions

View File

@@ -50,10 +50,7 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex
};
this.currentFolderPath = 'swsdp/documentLibrary';
this.route = [];
this.documentActions = [];
this.quickDocumentActions = [];
this.folderActions = [];
this.quickFolderActions = [];
this.actions = [];
this.columns = [];
}
DocumentList.prototype.canNavigateParent = function () {
@@ -71,6 +68,17 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex
componentHandler.upgradeAllRegistered();
}
};
DocumentList.prototype.getContentActions = function (target, type) {
if (target && type) {
var ltarget_1 = target.toLowerCase();
var ltype_1 = type.toLowerCase();
return this.actions.filter(function (entry) {
return entry.target.toLowerCase() === ltarget_1 &&
entry.type.toLowerCase() === ltype_1;
});
}
return [];
};
DocumentList.prototype.onNavigateParentClick = function ($event) {
if ($event) {
$event.preventDefault();
@@ -119,11 +127,6 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex
DocumentList.prototype.getDocumentThumbnailUrl = function (document) {
return this._alfrescoService.getDocumentThumbnailUrl(document);
};
DocumentList.prototype.registerDocumentAction = function (action) {
if (action) {
this.documentActions.push(action);
}
};
DocumentList.prototype.executeContentAction = function (document, action) {
// todo: safety checks
action.handler(document);