Improves selectors.

This commit is contained in:
Lars Jung 2013-09-03 16:12:31 +02:00
parent ad845dbe66
commit 66e9dafaa5
6 changed files with 50 additions and 67 deletions

View file

@ -29,7 +29,7 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
var contentWidth = $('#content').width(),
$view = $('#view'),
itemWidth = ($view.hasClass('view-icons') || $view.hasClass('view-grid')) ? ($view.find('.item').eq(0).width() || 1) : 1;
itemWidth = ($view.hasClass('view-icons') || $view.hasClass('view-grid')) ? ($view.find('.item').eq(0).outerWidth(true) || 1) : 1;
$view.width(Math.floor(contentWidth / itemWidth) * itemWidth);
},