Fix layout problem in IE and clean code.

This commit is contained in:
Lars Jung 2015-04-03 00:14:02 +02:00
parent 6549a49031
commit 6abeb383a8
3 changed files with 24 additions and 13 deletions

View file

@ -13,17 +13,20 @@
width: 240px;
.icon {
.rounded();
width: 240px;
height: 180px;
overflow: hidden;
margin: 0 auto;
img {
.rounded();
width: 240px;
max-height: 180px;
display: block;
overflow: hidden;
margin: 0 auto;
width: 180px;
height: 180px;
}
.thumb {
width: 240px;
}
}

View file

@ -43,12 +43,20 @@ modulejs.define('ext/info', ['_', '$', 'modernizr', 'core/settings', 'core/resou
function update(item) {
var src = resource.icon('folder');
if (!item.isCurrentFolder() && item.$view) {
src = item.$view.find('.icon.landscape img').attr('src');
var src = item.thumbRational || item.icon;
var isThumb = !!item.thumbRational;
if (item.isCurrentFolder() || !src) {
src = resource.icon('folder');
}
$img.attr('src', src);
if (isThumb) {
$img.addClass('thumb');
} else {
$img.removeClass('thumb');
}
$label.text(item.label);
if (_.isNumber(item.time)) {
$time.text(format.formatDate(item.time));

View file

@ -52,24 +52,24 @@ modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core
location.setLink($a, item);
$iconImg.attr('src', resource.icon(item.type)).attr('alt', item.type);
$label.text(item.label);
$label.attr('title', item.label);
$label.text(item.label).attr('title', item.label);
$date.data('time', item.time).text(format.formatDate(item.time));
$size.data('bytes', item.size).text(format.formatSize(item.size));
item.icon = resource.icon(item.type);
if (item.isFolder() && !item.isManaged) {
$html.addClass('page');
$iconImg.attr('src', resource.icon('folder-page'));
item.icon = resource.icon('folder-page');
}
if (item.isCurrentParentFolder()) {
$iconImg.attr('src', resource.icon('folder-parent'));
item.icon = resource.icon('folder-parent');
if (!settings.setParentFolderLabels) {
$label.addClass('l10n-parentDirectory');
}
$html.addClass('folder-parent');
}
$iconImg.attr('src', item.icon).attr('alt', item.type);
if (item.$view) {
item.$view.replaceWith($html);