comunication between components

This commit is contained in:
Mario Romano
2016-04-07 20:38:44 +01:00
parent ed8dd1dafb
commit c7597bb1ec
37 changed files with 25254 additions and 2 deletions

View File

@@ -36,6 +36,14 @@ Or [download as ZIP](https://github.com/eromano/alfresco-file-list/archive/maste
<alfresco-file-list></alfresco-file-list>
```
# publish-subscribe functionality
Add the code below to the main index.html in order to refresh the file list when a file is uploaded.
<template is="dom-bind" id="alfresco-app">
<iron-signals on-iron-signal-uploaded="uploadedSignal"></iron-signals>
</template>
```
## Options
Attribute | Options | Default | Description

View File

@@ -9,6 +9,7 @@
<link rel="import" href="../../../bower_components/paper-badge/paper-badge.html">
<link rel="import" href="../../../bower_components/paper-item/paper-item.html">
<link rel="import" href="../../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="../../../bower_components/iron-signals/iron-signals.html">
<style>
.pad {
@@ -140,7 +141,7 @@
</div>
</div>
<div lass="dropdowm menu">
<paper-dropdown-menu class="custom" label="Actions" no-label-float>
<paper-dropdown-menu class="custom pull-right" label="Actions" no-label-float>
<paper-listbox class="dropdown-content">
<paper-item>Download as Zip</paper-item>
<paper-item>View Details</paper-item>
@@ -187,6 +188,12 @@
ready: function() {
var initialFolder = 'swsdp/documentLibrary';
this.fetchFolderFolder(initialFolder);
var self = this;
if(document.querySelector("#alfresco-app")) {
document.querySelector("#alfresco-app").uploadedSignal = function (e, detail, sender) {
self.fetchFolderFolder(initialFolder);
};
}
},
fetchFolderFolder: function(slug) {