Files
klammertext/sks/code/js/code.js
Andy Kopra 2ba7ceee7a Initial commit: Klammertext source distribution
Curated source subset assembled by klammertext-dev's doc/make_dist.sh: the Klammermachine (mac), the Standard Klammer Set (sks), the commands (com), editor plugins and install guides (doc), a test subset (tst), and lib/bin placeholders. Builds with 'make -C com'.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 19:32:38 +02:00

21 lines
568 B
JavaScript

function adjust_code_comment_width()
{
let max_width = K.get("#text").offsetWidth;
K.getv(".code_comment").forEach(function (comment_box) {
let block = comment_box.parentNode;
let code_box = block.children[0];
let comment_width = max_width - code_box.offsetWidth;
K.width(comment_box, comment_width);
});
}
window.addEventListener("load", function (event) {
window.addEventListener(
"resize",
function (event) {
adjust_code_comment_width();
});
adjust_code_comment_width();
});