minor fixes
This commit is contained in:
parent
f85c1b9758
commit
c19476b824
3 changed files with 7 additions and 5 deletions
|
|
@ -168,6 +168,7 @@ function Editor(doc, renderer)
|
||||||
addListener(container, "mousedown", function(e) {
|
addListener(container, "mousedown", function(e) {
|
||||||
textInput.focus();
|
textInput.focus();
|
||||||
self.placeCursorToMouse(e.pageX, e.pageY);
|
self.placeCursorToMouse(e.pageX, e.pageY);
|
||||||
|
self.renderer.scrollCursorIntoView();
|
||||||
return preventDefault(e);
|
return preventDefault(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
function VirtualRenderer(containerId)
|
function VirtualRenderer(containerId)
|
||||||
{
|
{
|
||||||
DumbRenderer.call(this, containerId);
|
DumbRenderer.call(this, containerId);
|
||||||
|
|
||||||
this.scrollTop = 0;
|
this.scrollTop = 0;
|
||||||
this.firstRow = 0;
|
this.firstRow = 0;
|
||||||
|
|
||||||
|
|
@ -24,6 +25,7 @@ function VirtualRenderer(containerId)
|
||||||
update: this.updateMarkers
|
update: this.updateMarkers
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
inherits(VirtualRenderer, DumbRenderer);
|
inherits(VirtualRenderer, DumbRenderer);
|
||||||
|
|
||||||
VirtualRenderer.prototype.draw = function()
|
VirtualRenderer.prototype.draw = function()
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
cursor: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.composition {
|
.composition {
|
||||||
|
|
@ -105,10 +106,8 @@
|
||||||
|
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
|
||||||
var doc = new TextDocument("Juhu Kinners");
|
new Editor(new TextDocument("Juhu Kinners"), new VirtualRenderer("virtual_container"));
|
||||||
|
new Editor(new TextDocument("Juhu Kinners"), new DumbRenderer("container"));
|
||||||
new Editor(doc, new VirtualRenderer("virtual_container"));
|
|
||||||
new Editor(doc, new DumbRenderer("container"));
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue