updates on #9

This commit is contained in:
Henrique Dias
2015-09-19 19:54:52 +01:00
parent 9a99b39c73
commit 537fe27f2e
2 changed files with 4 additions and 9 deletions

View File

@@ -177,16 +177,11 @@ $(document).on('ready pjax:success', function() {
$(".delete").click(function(event) {
event.preventDefault();
name = $(this).parent().parent().attr("for");
if (name == "undefined") {
name = $(this).parent().parent().attr("id");
}
name = $(this).parent().parent().attr("for") || $(this).parent().parent().parent().attr("id");
console.log(name)
$('#' + name).remove();
$('label[for="' + name + '"]').remove();
$('#' + name).fadeOut().remove();
$('label[for="' + name + '"]').fadeOut().remove();
});
$('body').on('keypress', 'input', function(event) {