mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-06 14:56:51 +02:00
fix(albums): fixed albums size issue
This commit is contained in:
@@ -14,15 +14,26 @@
|
||||
vm.torrentTypeConfig = MeanTorrentConfig.meanTorrentConfig.torrentType;
|
||||
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
|
||||
|
||||
|
||||
/**
|
||||
* $scope.$watch($('#nav-top-menu').width())
|
||||
* $scope.$watch($('.albums-item').width())
|
||||
*/
|
||||
$scope.$watch(function () {
|
||||
return $('.albums-item').width();
|
||||
}, function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
$('.albums-item').height($('.albums-item').width() / 1.772);
|
||||
var elements = $('.albums-item img');
|
||||
|
||||
angular.forEach(elements, function(e){
|
||||
var element = angular.element(e);
|
||||
|
||||
element.parent().height(element.parent().width() / 1.772);
|
||||
|
||||
if (element.height() > element.parent().height()) {
|
||||
element.css('margin-top', -(element.height() - element.parent().height()) / 2);
|
||||
} else {
|
||||
element.css('margin-top', (element.parent().height() - element.height()) / 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -17,13 +17,25 @@
|
||||
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
|
||||
|
||||
/**
|
||||
* $scope.$watch($('#nav-top-menu').width())
|
||||
* $scope.$watch($('collection-item').width())
|
||||
*/
|
||||
$scope.$watch(function () {
|
||||
return $('.albums-item').width();
|
||||
return $('.collection-item').width();
|
||||
}, function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
$('.albums-item').height($('.albums-item').width() / 1.772);
|
||||
var elements = $('.collection-item img');
|
||||
|
||||
angular.forEach(elements, function(e){
|
||||
var element = angular.element(e);
|
||||
|
||||
element.parent().height(element.parent().width() / 1.772);
|
||||
|
||||
if (element.height() > element.parent().height()) {
|
||||
element.css('margin-top', -(element.height() - element.parent().height()) / 2);
|
||||
} else {
|
||||
element.css('margin-top', (element.parent().height() - element.height()) / 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -70,13 +70,25 @@
|
||||
};
|
||||
|
||||
/**
|
||||
* $scope.$watch($('#nav-top-menu').width())
|
||||
* $scope.$watch($('.albums-item').width())
|
||||
*/
|
||||
$scope.$watch(function () {
|
||||
return $('.albums-item').width();
|
||||
}, function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
$('.albums-item').height($('.albums-item').width() / 1.772);
|
||||
var elements = $('.albums-item img');
|
||||
|
||||
angular.forEach(elements, function(e){
|
||||
var element = angular.element(e);
|
||||
|
||||
element.parent().height(element.parent().width() / 1.772);
|
||||
|
||||
if (element.height() > element.parent().height()) {
|
||||
element.css('margin-top', -(element.height() - element.parent().height()) / 2);
|
||||
} else {
|
||||
element.css('margin-top', (element.parent().height() - element.height()) / 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user