cleanup
This commit is contained in:
parent
a6c21c6761
commit
15dd2082f6
2 changed files with 7 additions and 7 deletions
|
|
@ -86,7 +86,7 @@ function DefaultHandlers(mouseHandler) {
|
|||
if (inSelection && !editor.isFocused()) {
|
||||
editor.focus();
|
||||
if (this.$focusTimout && !this.$clickSelection && !editor.inMultiSelectMode) {
|
||||
this.mousedownEvent.time = (new Date()).getTime();
|
||||
this.mousedownEvent.time = Date.now();
|
||||
this.setState("focusWait");
|
||||
this.captureMouse(ev);
|
||||
return;
|
||||
|
|
@ -98,7 +98,7 @@ function DefaultHandlers(mouseHandler) {
|
|||
// a selection.
|
||||
this.startSelect(pos);
|
||||
} else if (inSelection) {
|
||||
this.mousedownEvent.time = (new Date()).getTime();
|
||||
this.mousedownEvent.time = Date.now();
|
||||
this.startSelect(pos);
|
||||
}
|
||||
this.captureMouse(ev);
|
||||
|
|
@ -193,7 +193,7 @@ function DefaultHandlers(mouseHandler) {
|
|||
|
||||
this.focusWait = function() {
|
||||
var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
|
||||
var time = (new Date()).getTime();
|
||||
var time = Date.now();
|
||||
|
||||
if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimout)
|
||||
this.startSelect(this.mousedownEvent.getDocumentPosition());
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ function DragdropHandler(mouseHandler) {
|
|||
event.addListener(mouseTarget, "drop", this.onDrop.bind(mouseHandler));
|
||||
|
||||
function scrollCursorIntoView(cursor, prevCursor) {
|
||||
var now = new Date().getTime();
|
||||
var now = Date.now();
|
||||
var vMovement = !prevCursor || cursor.row != prevCursor.row;
|
||||
var hMovement = !prevCursor || cursor.column != prevCursor.column;
|
||||
if (!cursorMovedTime || vMovement || hMovement) {
|
||||
|
|
@ -214,7 +214,7 @@ function DragdropHandler(mouseHandler) {
|
|||
}
|
||||
|
||||
function autoScroll(cursor, prevCursor) {
|
||||
var now = new Date().getTime();
|
||||
var now = Date.now();
|
||||
var lineHeight = editor.renderer.layerConfig.lineHeight;
|
||||
var characterWidth = editor.renderer.layerConfig.characterWidth;
|
||||
var editorRect = editor.renderer.scroller.getBoundingClientRect();
|
||||
|
|
@ -330,7 +330,7 @@ function DragdropHandler(mouseHandler) {
|
|||
(function() {
|
||||
|
||||
this.dragWait = function() {
|
||||
var interval = (new Date()).getTime() - this.mousedownEvent.time;
|
||||
var interval = Date.now() - this.mousedownEvent.time;
|
||||
if (interval > this.editor.getDragDelay())
|
||||
this.startDrag();
|
||||
};
|
||||
|
|
@ -384,7 +384,7 @@ function DragdropHandler(mouseHandler) {
|
|||
var button = e.getButton();
|
||||
var clickCount = e.domEvent.detail || 1;
|
||||
if (clickCount === 1 && button === 0 && inSelection) {
|
||||
this.mousedownEvent.time = (new Date()).getTime();
|
||||
this.mousedownEvent.time = Date.now();
|
||||
var eventTarget = e.domEvent.target || e.domEvent.srcElement;
|
||||
if ("unselectable" in eventTarget)
|
||||
eventTarget.unselectable = "on";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue