mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-04 08:57:59 +02:00
fix(collections): fixed collection item height issue
This commit is contained in:
@@ -6,16 +6,29 @@
|
||||
.controller('CollectionController', CollectionController);
|
||||
|
||||
CollectionController.$inject = ['$scope', '$translate', 'getStorageLangService', 'MeanTorrentConfig', 'CollectionsService', 'NotifycationService',
|
||||
'DebugConsoleService'];
|
||||
'DebugConsoleService', '$timeout'];
|
||||
|
||||
function CollectionController($scope, $translate, getStorageLangService, MeanTorrentConfig, CollectionsService, NotifycationService,
|
||||
mtDebug) {
|
||||
mtDebug, $timeout) {
|
||||
var vm = this;
|
||||
vm.lang = getStorageLangService.getLang();
|
||||
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
|
||||
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
|
||||
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
|
||||
|
||||
/**
|
||||
* window.resize()
|
||||
*/
|
||||
$(window).resize(function () {
|
||||
vm.setAlbumItemHeight();
|
||||
});
|
||||
|
||||
/**
|
||||
* setAlbumItemHeight
|
||||
*/
|
||||
vm.setAlbumItemHeight = function () {
|
||||
$('.collection-item').height($('.collection-item').width() / 1.772);
|
||||
};
|
||||
|
||||
/**
|
||||
* buildPager
|
||||
@@ -37,6 +50,10 @@
|
||||
vm.filterLength = items.total;
|
||||
vm.pagedItems = items.rows;
|
||||
|
||||
$timeout(function () {
|
||||
vm.setAlbumItemHeight();
|
||||
}, 10)
|
||||
|
||||
if (callback) callback();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="collection-items">
|
||||
<div ng-repeat="m in vm.pagedItems">
|
||||
<div ng-repeat="m in vm.pagedItems" ng-if="m.torrents.length>0">
|
||||
<div data-ng-if="$index != 0 && $index % 2 == 0" class="clearfix visible-sm-block"></div>
|
||||
<div data-ng-if="$index != 0 && $index % 3 == 0" class="clearfix visible-md-block visible-lg-block"></div>
|
||||
<div class="col-sm-6 col-md-4">
|
||||
|
||||
Reference in New Issue
Block a user