summaryrefslogtreecommitdiffstats
path: root/core/js/shareitemmodel.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-08-11 22:36:28 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-16 07:23:25 +0200
commit97b5fe0b1e7ece1c402f9226f13a6e9d711055cf (patch)
treede0a6b3a948b936e1f25c5b8b11debbead029d09 /core/js/shareitemmodel.js
parente6edc3e05dfc17584c81d11c52b444ffcf965c62 (diff)
downloadnextcloud-server-97b5fe0b1e7ece1c402f9226f13a6e9d711055cf.tar.gz
nextcloud-server-97b5fe0b1e7ece1c402f9226f13a6e9d711055cf.zip
switch to async item loading, take care stuff is updated subsequently
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r--core/js/shareitemmodel.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index 74e696e7200..fe7aed46509 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -66,6 +66,14 @@
},
/**
+ * whether this item has reshare information
+ * @returns {boolean}
+ */
+ hasShares: function() {
+ return _.isObject(this.get('shares'));
+ },
+
+ /**
* @returns {string}
*/
getReshareOwner: function() {
@@ -94,16 +102,16 @@
},
fetch: function() {
- /** var {OC.Share.Types.ShareItemInfo} **/
- var data = OC.Share.loadItem(this.get('itemType'), this.get('itemSource'));
- var attributes = this.parse(data);
- this.set(attributes);
- console.warn(this.attributes);
+ var model = this;
+ OC.Share.loadItem(this.get('itemType'), this.get('itemSource'), function(data) {
+ model.set(model.parse(data));
+ });
},
parse: function(data) {
if(data === false) {
console.warn('no data was returned');
+ trigger('fetchError');
return {};
}
var attributes = {