Commit c1ac550c authored by echicken's avatar echicken
Browse files

If it was a left click, return an object.

Currently this only has a 'line' property, being which line from the
source document was clicked.
It may later become useful to report which position in the original
string was clicked, or what word, etc.
parent 844eafd6
......@@ -168,7 +168,9 @@ ScrollBox.prototype.getcmd = function (c) {
if (c.mouse && c.mouse.press && c.mouse.y >= this.y1 && c.mouse.y <= this.y2) {
if (c.mouse.button == 64) return this.getcmd({ key: KEY_UP, mouse: null });
if (c.mouse.button == 65) return this.getcmd({ key: KEY_DOWN, mouse: null });
if (c.mouse.button == 0) return this.line_map[c.mouse.y + this.y - this.y1];
if (c.mouse.button == 0) {
return { line: this.line_map[c.mouse.y + this.y - this.y1] };
}
return true;
}
if (c.key == KEY_UP) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment