#8374: Making postLimitHeight an addon parameter

This commit is contained in:
Christian Wiwie 2020-03-14 22:09:30 +01:00
parent ab24c621b2
commit ed45145415
3 changed files with 55 additions and 6 deletions

View file

@ -1,4 +1,8 @@
$(document).ready(function(){
$("head").append('<style type="text/css"></style>');
var newStyleElement = $("head").children(':last');
newStyleElement.html('.limit-height{max-height: ' + postLimitHeight + 'px; overflow: hidden;}');
handleNewWallItemBodies();
document.addEventListener("postprocess_liveupdate", function() {
@ -60,7 +64,7 @@ function processHeightLimit($item) {
var itemId = $item.data("item-id");
var $toggle = $("#wall-item-body-toggle-" + itemId);
if ($item.height() < 250) {
if ($item.height() < postLimitHeight) {
$item.removeClass("limit-height");
$toggle.hide();
return false;