editor is now full screen

This commit is contained in:
Fabian Jakobs 2010-04-06 16:37:29 +02:00
commit 21a739a961
2 changed files with 15 additions and 20 deletions

View file

@ -200,6 +200,10 @@ Editor.prototype =
this.renderer.updateCursor(this.cursor); this.renderer.updateCursor(this.cursor);
}, },
resize : function() {
this.renderer.draw();
},
updateCursor : function() { updateCursor : function() {
this.renderer.updateCursor(this.cursor); this.renderer.updateCursor(this.cursor);
}, },

View file

@ -9,26 +9,15 @@
<style type="text/css" media="screen"> <style type="text/css" media="screen">
#virtual_container { #container {
position: absolute; position: absolute;
border: 1px solid black; border: 1px solid black;
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
width: 600px; top: 5px;
height: 400px; right: 5px;
} bottom: 5px;
left: 5px;
#virtual_container.focus {
border: 1px solid #327fbd;;
}
#container {
position: absolute;
left: 630px;
border: 1px solid black;
overflow: auto;
width: 600px;
height: 400px;
} }
#container.focus { #container.focus {
@ -98,15 +87,17 @@
</head> </head>
<body> <body>
<div id="virtual_container">
</div>
<div id="container"> <div id="container">
</div> </div>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
new Editor(new TextDocument("Juhu Kinners"), new VirtualRenderer("virtual_container")); var editor = new Editor(new TextDocument("Juhu Kinners"), new VirtualRenderer("container"));
window.onresize = function() {
console.log("resize");
editor.resize();
}
</script> </script>