minor fixes

This commit is contained in:
Fabian Jakobs 2010-04-06 14:54:54 +02:00
commit c19476b824
3 changed files with 7 additions and 5 deletions

View file

@ -168,6 +168,7 @@ function Editor(doc, renderer)
addListener(container, "mousedown", function(e) {
textInput.focus();
self.placeCursorToMouse(e.pageX, e.pageY);
self.renderer.scrollCursorIntoView();
return preventDefault(e);
});

View file

@ -1,6 +1,7 @@
function VirtualRenderer(containerId)
{
DumbRenderer.call(this, containerId);
this.scrollTop = 0;
this.firstRow = 0;
@ -24,6 +25,7 @@ function VirtualRenderer(containerId)
update: this.updateMarkers
});
}
inherits(VirtualRenderer, DumbRenderer);
VirtualRenderer.prototype.draw = function()

View file

@ -44,7 +44,8 @@
font-size: 14px;
white-space: nowrap;
-webkit-box-sizing: border-box;
box-sizing: border-box;
box-sizing: border-box;
cursor: text;
}
.composition {
@ -105,10 +106,8 @@
<script type="text/javascript" charset="utf-8">
var doc = new TextDocument("Juhu Kinners");
new Editor(doc, new VirtualRenderer("virtual_container"));
new Editor(doc, new DumbRenderer("container"));
new Editor(new TextDocument("Juhu Kinners"), new VirtualRenderer("virtual_container"));
new Editor(new TextDocument("Juhu Kinners"), new DumbRenderer("container"));
</script>