Currently, support Delete key and arrow keys
This commit is contained in:
parent
a8c37ff639
commit
4c996020f7
@ -5,7 +5,7 @@ $('li[contenteditable]').click(function(e) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('li[contenteditable]').on('keydown', function(e) {
|
$('li[contenteditable]').on('keydown', function(e) {
|
||||||
if(e.keyCode !== 8 && isNaN(+e.key)) return e.preventDefault();
|
if([8, 37, 38, 39 ,40, 46].indexOf(e.keyCode) < 0 && isNaN(+e.key)) return e.preventDefault();
|
||||||
});
|
});
|
||||||
$('li[contenteditable]').on('keyup', function(e) {
|
$('li[contenteditable]').on('keyup', function(e) {
|
||||||
$(this).data('val', /\d*/.exec($(this).html()));
|
$(this).data('val', /\d*/.exec($(this).html()));
|
||||||
|
Loading…
Reference in New Issue
Block a user