diff --git a/modules/ve2/ce/ve.ce.Surface.js b/modules/ve2/ce/ve.ce.Surface.js index 05abb09c38..c0cccba106 100644 --- a/modules/ve2/ce/ve.ce.Surface.js +++ b/modules/ve2/ce/ve.ce.Surface.js @@ -532,9 +532,8 @@ ve.ce.Surface.prototype.onPaste = function( e ) { }; ve.ce.Surface.prototype.handleEnter = function() { - /* TODO: Determine if we still need this this.stopPolling(); - */ + var selection = this.model.getSelection(), tx; @@ -575,18 +574,12 @@ ve.ce.Surface.prototype.handleEnter = function() { this.showCursor(selection.from); this.model.setSelection( new ve.Range( selection.from ) ); - /* TODO: Determine if we still need this - var _this = this; - setTimeout( function() { - _this.poll.prevText = _this.poll.prevHash = _this.poll.prevOffset = _this.poll.node = null; - _this.startPolling(); - }, 0 ); - */ + this.clearPollData(); + this.startPolling(); }; ve.ce.Surface.prototype.handleDelete = function( backspace ) { this.stopPolling(); - this.clearPollData(); var selection = this.model.getSelection(), sourceOffset, @@ -676,6 +669,7 @@ return; this.showCursor(cursorAt); this.model.setSelection( new ve.Range( cursorAt ) ); + this.clearPollData(); this.startPolling(); };