MCPcopy Index your code
hub / github.com/prettydiff/prettydiff / fixHeight

Function fixHeight

api/prettydiff-webtool.ts:505–545  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

503 }
504 },
505 fixHeight = function dom_load_fixHeight():void {
506 const input:HTMLElement = id("input"),
507 output:HTMLElement = id("output"),
508 headlineNode:HTMLElement = id("headline"),
509 height:number = window.innerHeight || document.getElementsByTagName("body")[0].clientHeight;
510 let math:number = 0,
511 headline:number = 0;
512 if (headlineNode !== null && headlineNode.style.display === "block") {
513 headline = 3.8;
514 }
515 if (test.ace === true) {
516 math = (height / 14) - (15.81 + headline);
517 aceStore.height = math;
518 if (input !== null) {
519 input.style.height = `${math}em`;
520 aceStore
521 .codeIn
522 .setStyle(`height:${math}em`);
523 aceStore
524 .codeIn
525 .resize();
526 }
527 if (output !== null) {
528 output.style.height = `${math}em`;
529 aceStore
530 .codeOut
531 .setStyle(`height:${math}em`);
532 aceStore
533 .codeOut
534 .resize();
535 }
536 } else {
537 math = (height / 14.4) - (15.425 + headline);
538 if (input !== null) {
539 input.style.height = `${math}em`;
540 }
541 if (output !== null) {
542 output.style.height = `${math}em`;
543 }
544 }
545 },
546 indentchar = function dom_load_indentchar():void {
547 const insize:HTMLInputElement = id("option-indent_size"),
548 inchar:HTMLInputElement = id("option-indent_char");

Callers 1

loadFunction · 0.85

Calls 1

idFunction · 0.85

Tested by

no test coverage detected