Skip to content

Commit

Permalink
[WebUI IntelliHome#7] Fixed some javascript functions
Browse files Browse the repository at this point in the history
  • Loading branch information
skullbocks committed Aug 19, 2014
1 parent 96538d9 commit 1e040f6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions assets/public/js/functions_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
window.location.href = $(this).attr("data-post");
});
$body.on('click', '.delete-row', function() {
alert("/delete_" + $(this).attr("data-type") + "/" + $(this).parent().parent().attr("id"));
$.post("/admin/delete_" + $(this).attr("data-type") + "/" + $(this).parent().parent().attr("id"), function(data) {
$(this).parent().parent().remove();
}, "json");
if (data == 1) {
$(this).parent().parent().hide("fast").remove();
}
});
});
$gpioPopover.popover({
html: true,
Expand Down Expand Up @@ -47,10 +48,12 @@
this.reset();
});
if ($thisButton.hasClass('is-popover')) {
$thisButton.parent(".form-data-body").hide('fast');
$thisButton.parent().parent(".form-data-body").hide('fast');
$thisButton.parent().parent().parent('.popover-content').find(".popover-form-open").fadeIn('fast');
} else {
$thisButton.parent(".modal").modal("hide");
$thisButton.parent().parent().parent().parent(".modal").modal("hide");
}
window.location.reload();
},
'json' // JSON response
);
Expand All @@ -60,7 +63,7 @@
$(this).parent('.popover-content').find(".form-data-body").fadeIn("fast").toggleClass('hide');
});
$body.on('click','.popover-form-close',function(){
$(this).parent().parent(".form-data-body").fadeOut("fast").toggleClass('hide');
$(this).parent().parent(".form-data-body").hide("fast").toggleClass('hide');
$(this).parent().parent().parent('.popover-content').find(".popover-form-open").fadeIn('fast');
});
$('#fancyClock').tzineClock();
Expand Down

0 comments on commit 1e040f6

Please sign in to comment.