Warning: session_start(): open(/var/lib/php/sessions/sess_15vqvrsrds93acc6qgqd9j33d2, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass HDivWithVerticalExpandButton {
int initialHeight;
S expandButtonText = "Read more";
O contents;
S btnID = aGlobalID();
*(int *initialHeight, O *contents) {}
S html() {
ret div(contents, class := "expandable",
style := "padding: 20px 10px; max-height: " + initialHeight + "px; overflow: hidden;") + "\n"
+ hbutton(expandButtonText, onclick := [[
$(this).prev('.expandable').css('max-height', 'none');
$(this).hide();
]], style := "display: none", id := btnID) + "\n"
+ hjs([[
{
let btn = $(]] + jsQuote("#" + btnID) + [[);
let check = function() {
$(btn).toggle($(btn).prev('.expandable').outerHeight() >= ]] + initialHeight + [[);
console.log("this=" + this);
setTimeout(this, 5000);
};
check = check.bind(check); // enable "this" inside check()
check(); setTimeout(check, 1000);
}
]]);
}
bool needsJQuery() { true; }
}