[showmore_dyn] Add support for 0 value to disable addon

This commit is contained in:
Hypolite Petovan 2020-12-31 09:13:00 -05:00
parent ceb4f461da
commit 39280ea6bd
2 changed files with 10 additions and 14 deletions

View file

@ -6,15 +6,14 @@ $(document).ready(function() {
return;
}
$("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() {
if (postLimitHeight) {
$('head').append('<style type="text/css">.limit-height{max-height: ' + postLimitHeight + 'px; overflow: hidden; }</style>');
handleNewWallItemBodies();
});
document.addEventListener('postprocess_liveupdate', function() {
handleNewWallItemBodies();
});
}
});
function handleNewWallItemBodies() {