Firefox prompt huge fix, Issue #59

This commit is contained in:
Peter Cottle 2013-03-02 10:39:54 -08:00
parent a7c2b8936c
commit d17d131d24
7 changed files with 18 additions and 10 deletions

View file

@ -74,7 +74,7 @@ var CommandPromptView = Backbone.View.extend({
},
onKeyDown: function(e) {
var el = e.srcElement;
var el = e.srcElement || e.currentTarget;
this.updatePrompt(el);
},
@ -131,7 +131,7 @@ var CommandPromptView = Backbone.View.extend({
cursorUpdate: function(commandLength, selectionStart, selectionEnd) {
if (selectionStart === undefined || selectionEnd === undefined) {
selectionStart = commandLength - 1;
selectionStart = Math.max(commandLength - 1, 0);
selectionEnd = commandLength;
}