improved grid display without masonry

This commit is contained in:
2018-04-27 17:06:56 +02:00
parent 51f25bd347
commit cab8fca868
3 changed files with 16 additions and 5 deletions
@@ -1537,13 +1537,20 @@
function checkGridBlockHeight(){
console.log('checkGridBlockHeight');
var $r_h = _$row.height();
var $this;
// console.log($r_h);
$('.grid .col', _$row).each(function(i,e){
// console.log($(this).height(), $(this).innerHeight(), $(this).outerHeight());
if($(this).height() > $r_h){
$(this).height($r_h);
$this = $(this);
if(!$this.is('[init-height]')){
$this.attr('init-height', $this.outerHeight())
}
// $(this).innerHeight(Math.min($(this).innerHeight(), _$row.height()));
// console.log($(this).height(), $(this).innerHeight(), $(this).outerHeight());
// if($this.height() > $r_h){
// $this.height($r_h);
// }else{
// $this.height('auto');
// }
$this.height(Math.min($this.attr('init-height'), _$row.height()));
});
};
@@ -1558,6 +1565,8 @@
console.log(pos.top, $this.height(), pos.top+$this.height(), $r_h, $this);
if(pos.top+$this.height() <= $r_h){
$this.removeClass('offfield');
}else{
$this.addClass('offfield');
}
// });
});