collapsible.js: Don't collapse containers which are near to the maximum
This commit is contained in:
parent
c5ebaa2bde
commit
fc782b59a9
|
@ -101,7 +101,16 @@
|
||||||
if (!! rowSelector) {
|
if (!! rowSelector) {
|
||||||
return $(rowSelector, $collapsible).length > ($collapsible.data('visibleRows') || this.defaultVisibleRows);
|
return $(rowSelector, $collapsible).length > ($collapsible.data('visibleRows') || this.defaultVisibleRows);
|
||||||
} else {
|
} else {
|
||||||
return $collapsible.innerHeight() > ($collapsible.data('visibleHeight') || this.defaultVisibleHeight);
|
var actualHeight = $collapsible.innerHeight(),
|
||||||
|
maxHeight = $collapsible.data('visibleHeight') || this.defaultVisibleHeight;
|
||||||
|
|
||||||
|
if (actualHeight <= maxHeight) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Although the height seems larger than what it should be, make sure it's not just a small fraction
|
||||||
|
// i.e. more than 12 pixel and at least 10% difference
|
||||||
|
return actualHeight - maxHeight > 12 && actualHeight / maxHeight >= 1.1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue