Support delete key on contenteditable div.
This commit is contained in:
parent
96a273b6dc
commit
c312e52fab
@ -7,7 +7,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(e.keyCode !== 8 && e.keyCode !== 46 && 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