Skip to content

Commit dc8399f

Browse files
author
Martii
committed
More followup for source code has tiny height
* Ace needs a hard resize event pushed for some newer browsers when maximizing. e.g. show more lines in code * Push the function up so it doesn't generate a strict warning if we add that Applies to OpenUserJS#136
1 parent 5508b7a commit dc8399f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

views/includes/scripts/scriptEditor.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
return window.innerHeight - {{#newScript}}190{{/newScript}}{{^newScript}}302{{/newScript}};
3131
}
3232

33+
function onresize() {
34+
$("#editor").height(calcHeight);
35+
editor.resize(true);
36+
}
37+
3338
editor.setTheme("ace/theme/dawn");
3439
editor.getSession().setMode("ace/mode/javascript");
3540

@@ -46,10 +51,6 @@
4651
if (!hasOurRelative()) {
4752
$("#editor").height(calcHeight());
4853

49-
function onresize() {
50-
$("#editor").height(calcHeight);
51-
}
52-
5354
if (window.addEventListener) {
5455
window.addEventListener('resize', onresize, false);
5556
} else if (window.attachEvent) {

0 commit comments

Comments
 (0)