Last active
April 1, 2016 02:27
-
-
Save tjstalcup/ae720b5634388a5b32ed42a6e2807fa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('click', '.fa-edit', function () { | |
var $el = $(this).parent().parent().parent().parent().children('.left'); | |
var value = $el.text(); | |
$el.html('<input type="text" id="edit" value="'+value+'"/>'); | |
$('#edit').focus(); | |
}); | |
$(document).on('keyup', '#edit', function(e){ | |
// enter | |
if(e.which==13){ | |
var value = $(this).val(); | |
var $el = $(this).parent(); | |
$el.html(value); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment