Conditions | 3 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | $("#body").on("click keydown", function (e) { |
||
14 | function previewRender(e) { |
||
15 | e.preventDefault(); |
||
16 | var bodyx = $("#body"); |
||
17 | bodyx.trigger("click"); |
||
18 | /** |
||
19 | * @type {HTMLIFrameElement} |
||
20 | */ |
||
21 | var ifr = document.getElementById("FileFrame"); |
||
22 | var doc = ifr.contentWindow.document; |
||
23 | doc.open(); |
||
24 | doc.write(bodyx.val()); |
||
25 | doc.close(); |
||
26 | |||
27 | setTimeout(() => { |
||
28 | // auto resize iframe by content height |
||
29 | ifr.style.height = |
||
30 | document.getElementById("FileFrame").contentWindow.document |
||
31 | .documentElement.scrollHeight + "px"; |
||
32 | }, 1000); |
||
33 | } |
||
34 |