Created
January 10, 2013 00:50
-
-
Save njx/4498433 to your computer and use it in GitHub Desktop.
CodeMirror line widget resize bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Widget Resize Bug</title> | |
<link rel="stylesheet" href="lib/codemirror.css"> | |
<script src="lib/codemirror.js"></script> | |
<link rel="stylesheet" href="doc/docs.css"> | |
<style type="text/css"> | |
.CodeMirror {border: 1px solid black;} | |
</style> | |
</head> | |
<body> | |
<h1>Widget Resize Bug</h1> | |
<div id="editor"></div> | |
<script id="script"> | |
window.onload = function() { | |
var content = ""; | |
for (var i = 0; i < 100; i++) { | |
content += "Line " + i + "\n"; | |
} | |
window.editor = CodeMirror(document.getElementById("editor"), { | |
lineNumbers: true, | |
value: content | |
}); | |
window.widgetNode = document.createElement("div"); | |
window.widgetNode.style.backgroundColor = "#666666"; | |
window.widgetNode.style.height = "1000px"; | |
window.lineWidget = editor.addLineWidget(1, window.widgetNode); | |
}; | |
</script> | |
<input type="button" value="Resize Widget" onclick="window.widgetNode.style.height='100px'; editor.refresh();"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment