Skip to content

Commit 7683f6b

Browse files
committed
support previewing selected files(only icons)
1 parent 7647f17 commit 7683f6b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

public/css/lfm.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ a {
9191
background-position: center;
9292
background-size: contain;
9393
background-repeat: no-repeat;
94+
margin: 0 auto;
9495
}
9596

9697
/* Loader */

public/js/script.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,13 @@ function preview(items) {
389389
items.forEach(function (item, index) {
390390
var carouselItem = imageTemplate.clone()
391391
.addClass(index === 0 ? 'active' : '');
392-
carouselItem.find('.carousel-image')
393-
// .addClass('mime-icon ico-' + item.icon);
394-
.css('background-image', 'url(\'' + item.url + '?timestamp=' + item.time + '\')');
392+
393+
if (item.thumb_url) {
394+
carouselItem.find('.carousel-image').css('background-image', 'url(\'' + item.url + '?timestamp=' + item.time + '\')');
395+
} else {
396+
carouselItem.find('.carousel-image').css('width', '50vh').append($('<div>').addClass('mime-icon ico-' + item.icon));
397+
}
398+
395399
carousel.children('.carousel-inner').append(carouselItem);
396400

397401
var carouselIndicator = indicatorTemplate.clone()

0 commit comments

Comments
 (0)