From ffb31e5cb00e99ea5aaa80be5c8883627b8c688f Mon Sep 17 00:00:00 2001 From: lian Date: Mon, 8 Jun 2015 12:02:21 +0800 Subject: [PATCH] [starred-file] fix bug when generate file view url --- seahub/templates/js/templates.html | 4 ++-- static/scripts/app/views/starred-file-item.js | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/seahub/templates/js/templates.html b/seahub/templates/js/templates.html index 9f39a3cde9..a589fb44bc 100644 --- a/seahub/templates/js/templates.html +++ b/seahub/templates/js/templates.html @@ -700,9 +700,9 @@ {% trans <% if (is_img) { %> - <%- file_name %> + <%- file_name %> <% } else { %> - <%- file_name %> + <%- file_name %> <% } %> diff --git a/static/scripts/app/views/starred-file-item.js b/static/scripts/app/views/starred-file-item.js index 4fea15e098..0e18bb732f 100644 --- a/static/scripts/app/views/starred-file-item.js +++ b/static/scripts/app/views/starred-file-item.js @@ -21,11 +21,10 @@ define([ }, render: function () { - var data = this.model.toJSON(), - file_name = data['file_name']; + var data = this.model.toJSON(); - data['is_img'] = Common.imageCheck(file_name); - data['encoded_path'] = Common.encodePath(file_name); + data['is_img'] = Common.imageCheck(data['file_name']); + data['encoded_path'] = Common.encodePath(data['path']); this.$el.html(this.template(data)); return this;