1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 19:01:42 +00:00

[favourites] modified file icon

This commit is contained in:
llj
2017-09-18 15:38:26 +08:00
parent 6864bfeccd
commit 2b5b811ec3
3 changed files with 6 additions and 3 deletions

View File

@@ -1454,7 +1454,7 @@
<% if (encoded_thumbnail_src) { %> <% if (encoded_thumbnail_src) { %>
<img class="thumbnail" src="{{ SITE_ROOT }}<%= encoded_thumbnail_src %>" alt="" /> <img class="thumbnail" src="{{ SITE_ROOT }}<%= encoded_thumbnail_src %>" alt="" />
<% } else { %> <% } else { %>
<img src="{{ MEDIA_URL }}img/file/<%= icon_path %>" alt="{% trans "icon" %}" /> <img src="<%= file_icon_url %>" alt="{% trans "icon" %}" width="24" />
<% } %> <% } %>
</td> </td>
<td> <td>
@@ -1475,7 +1475,7 @@
<% if (encoded_thumbnail_src) { %> <% if (encoded_thumbnail_src) { %>
<img class="thumbnail" src="{{ SITE_ROOT }}<%= encoded_thumbnail_src %>" alt="" /> <img class="thumbnail" src="{{ SITE_ROOT }}<%= encoded_thumbnail_src %>" alt="" />
<% } else { %> <% } else { %>
<img src="{{ MEDIA_URL }}img/file/<%= icon_path %>" alt="{% trans "icon" %}" /> <img src="<%= file_icon_url %>" alt="{% trans "icon" %}" width="24" />
<% } %> <% } %>
</td> </td>
<td> <td>

View File

@@ -26,6 +26,9 @@ define([
render: function () { render: function () {
var data = this.model.toJSON(); var data = this.model.toJSON();
var file_icon_size = Common.isHiDPI() ? 48 : 24;
data.file_icon_url = Common.getFileIconUrl(data.file_name, file_icon_size);
data['is_img'] = Common.imageCheck(data['file_name']); data['is_img'] = Common.imageCheck(data['file_name']);
data['encoded_path'] = Common.encodePath(data['path']); data['encoded_path'] = Common.encodePath(data['path']);
data.encoded_thumbnail_src = this.model.get('encoded_thumbnail_src') || ''; data.encoded_thumbnail_src = this.model.get('encoded_thumbnail_src') || '';

View File

@@ -5,7 +5,7 @@ define([
'common', 'common',
'jquery.magnific-popup', 'jquery.magnific-popup',
'app/views/starred-file-item', 'app/views/starred-file-item',
'app/collections/starred-files', 'app/collections/starred-files'
], function($, _, Backbone, Common, magnificPopup, StarredFileItem, ], function($, _, Backbone, Common, magnificPopup, StarredFileItem,
StarredFilesCollection) { StarredFilesCollection) {
'use strict'; 'use strict';