Review fixes: Changed mousedown to click and changed event naming to use camelCase. Removed unnecessary exports
This commit is contained in:
parent
0582153019
commit
19f1d99a98
1 changed files with 5 additions and 8 deletions
|
|
@ -36,10 +36,10 @@ require("../config").defineOptions(Editor.prototype, "editor", {
|
|||
enableLinking: {
|
||||
set: function(val) {
|
||||
if (val) {
|
||||
this.on("mousedown", onMouseDown);
|
||||
this.on("click", onClick);
|
||||
this.on("mousemove", onMouseMove);
|
||||
} else {
|
||||
this.off("mousedown", onMouseDown);
|
||||
this.off("click", onClick);
|
||||
this.off("mousemove", onMouseMove);
|
||||
}
|
||||
},
|
||||
|
|
@ -57,11 +57,11 @@ function onMouseMove(e) {
|
|||
var session = editor.session;
|
||||
var token = session.getTokenAt(docPos.row, docPos.column);
|
||||
|
||||
editor._emit("link_hover", {position: docPos, token: token});
|
||||
editor._emit("linkHover", {position: docPos, token: token});
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseDown(e) {
|
||||
function onClick(e) {
|
||||
var ctrl = e.getAccelKey();
|
||||
var button = e.getButton();
|
||||
|
||||
|
|
@ -71,11 +71,8 @@ function onMouseDown(e) {
|
|||
var session = editor.session;
|
||||
var token = session.getTokenAt(docPos.row, docPos.column);
|
||||
|
||||
editor._emit("link", {position: docPos, token: token});
|
||||
editor._emit("linkClick", {position: docPos, token: token});
|
||||
}
|
||||
}
|
||||
|
||||
exports.onMouseMove = onMouseMove;
|
||||
exports.onMouseDown = onMouseDown;
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue