Starting and stopping polling for Enter

Change-Id: I398b6df242009f105bdb2214120779e6c5e57856
This commit is contained in:
Christian Williams 2012-06-14 17:21:05 -07:00
parent 4ea6d7e7b9
commit 87823835ad

View file

@ -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();
};