summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-03 08:24:50 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-03 08:24:50 +0200
commit3ea9f97c3644d30e03a28eaedd63350346536579 (patch)
treeb2ff0fbe501b7a2882ef580c6de5ba25cd4753e9 /apps/files/js
parent068ff09cfed6081ed794cf899830911f72c3e4fb (diff)
downloadnextcloud-server-3ea9f97c3644d30e03a28eaedd63350346536579.tar.gz
nextcloud-server-3ea9f97c3644d30e03a28eaedd63350346536579.zip
Fix sidebar thumbnail loading JS unit tests
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/fileinfomodel.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/files/js/fileinfomodel.js b/apps/files/js/fileinfomodel.js
index ab205b2efb4..22b1ca9ff0c 100644
--- a/apps/files/js/fileinfomodel.js
+++ b/apps/files/js/fileinfomodel.js
@@ -31,16 +31,15 @@
*/
var FileInfoModel = OC.Backbone.Model.extend({
+ defaults: {
+ mimetype: 'application/octet-stream',
+ path: ''
+ },
+
initialize: function(data) {
if (!_.isUndefined(data.id)) {
data.id = parseInt(data.id, 10);
}
-
- // TODO: normalize path
- data.path = data.path || '';
- data.name = data.name;
-
- data.mimetype = data.mimetype || 'application/octet-stream';
},
/**
@@ -58,7 +57,7 @@
* @return {boolean} true if this is an image, false otherwise
*/
isImage: function() {
- return this.get('mimetype')? this.get('mimetype').substr(0, 6) === 'image/' : false;
+ return this.has('mimetype') ? this.get('mimetype').substr(0, 6) === 'image/' : false;
},
/**