Skip to content

Commit

Permalink
Replace keyup with input event in cmd plugin #39
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 25, 2016
1 parent 9e17391 commit 05c930b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
9 changes: 5 additions & 4 deletions js/jquery.terminal-0.9.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Mon, 22 Feb 2016 16:43:07 +0000
* Date: Thu, 25 Feb 2016 18:25:26 +0000
*/

/* TODO:
Expand Down Expand Up @@ -1684,8 +1684,8 @@
destroy: function() {
doc.unbind('keypress.cmd', keypress_event);
doc.unbind('keydown.cmd', keydown_event);
doc.unbind('keyup.cmd', keyup_event);
doc.unbind('paste.cmd', paste);
doc.unbind('input.cmd', input);
self.stopTime('blink', blink);
self.find('.cursor').next().remove().end().prev().remove().
end().remove();
Expand Down Expand Up @@ -1843,8 +1843,9 @@
return result;
}
}
function keyup_event(e) {
function input(e) {
if (no_keypress) {
$.terminal.active().echo('not keypress');
// Some Androids don't fire keypress - #39
var val = clip.val();
if (val || e.which == 8) { // #209 ; 8 - backspace
Expand All @@ -1853,7 +1854,7 @@
}
}
doc.bind('keypress.cmd', keypress_event).bind('keydown.cmd', keydown_event).
bind('keyup.cmd', keyup_event);
bind('input.cmd', input);
if (is_paste_supported) {
doc.bind('paste.cmd', paste);
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-0.9.3.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/jquery.terminal-min.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -1684,8 +1684,8 @@
destroy: function() {
doc.unbind('keypress.cmd', keypress_event);
doc.unbind('keydown.cmd', keydown_event);
doc.unbind('keyup.cmd', keyup_event);
doc.unbind('paste.cmd', paste);
doc.unbind('input.cmd', input);
self.stopTime('blink', blink);
self.find('.cursor').next().remove().end().prev().remove().
end().remove();
Expand Down Expand Up @@ -1843,8 +1843,9 @@
return result;
}
}
function keyup_event(e) {
function input(e) {
if (no_keypress) {
$.terminal.active().echo('not keypress');
// Some Androids don't fire keypress - #39
var val = clip.val();
if (val || e.which == 8) { // #209 ; 8 - backspace
Expand All @@ -1853,7 +1854,7 @@
}
}
doc.bind('keypress.cmd', keypress_event).bind('keydown.cmd', keydown_event).
bind('keyup.cmd', keyup_event);
bind('input.cmd', input);
if (is_paste_supported) {
doc.bind('paste.cmd', paste);
}
Expand Down

0 comments on commit 05c930b

Please sign in to comment.