Skip to content

Commit

Permalink
Fix local var leak in full screen demo
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Feb 13, 2012
1 parent 43dc733 commit 4a9e300
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions demo/fullscreen.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,12 @@ <h1>CodeMirror: Full Screen Editing</h1>

</textarea></form>
<script>

var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
theme: "night",
extraKeys: {
"F11": function() {
scroller = editor.getScrollerElement();
var scroller = editor.getScrollerElement();
if (scroller.className.search(/\bCodeMirror-fullscreen\b/) === -1) {
scroller.className += " CodeMirror-fullscreen";
scroller.style.height = "100%";
Expand All @@ -130,7 +129,7 @@ <h1>CodeMirror: Full Screen Editing</h1>
}
},
"Esc": function() {
scroller = editor.getScrollerElement();
var scroller = editor.getScrollerElement();
if (scroller.className.search(/\bCodeMirror-fullscreen\b/) !== -1) {
scroller.className = scroller.className.replace(" CodeMirror-fullscreen", "");
scroller.style.height = '';
Expand All @@ -147,7 +146,7 @@ <h1>CodeMirror: Full Screen Editing</h1>

<p><strong>Note:</strong> Does not currently work correctly in IE
6 and 7, where setting the height of something
to <code>100%</code> doesn't make it full-screen.</p>
to <code>100%</code> doesn't make it full screen.</p>

</body>
</html>
</html>

0 comments on commit 4a9e300

Please sign in to comment.