Permalink
Browse files

Merge pull request #59 from pcpiela/master

Add a user confirmation before deleting a view
  • Loading branch information...
2 parents 7383ed8 + 5542093 commit 6b7ebd7763b7b0690f75e2bb933e64e97ec966d6 @vvuksan vvuksan committed Mar 29, 2012
Showing with 11 additions and 9 deletions.
  1. +11 −9 templates/default/views_view.tpl
@@ -27,15 +27,17 @@
.button()
.click(function() {
if ($("#vn").val() != "") {
- $.get('views_view.php?view_name=' +
- encodeURIComponent($("#vn").val()) +
- '&delete_view&views_menu',
- function(data) {
- $("#views_menu").html(data);
- $("#view_graphs").html("");
- $.cookie('ganglia-selected-view-' + window.name, "");
- $("#vn").val("");
- });
+ if (confirm("Are you sure you want to delete the view: " + $("#vn").val() + " ?")) {
+ $.get('views_view.php?view_name=' +
+ encodeURIComponent($("#vn").val()) +
+ '&delete_view&views_menu',
+ function(data) {
+ $("#views_menu").html(data);
+ $("#view_graphs").html("");
+ $.cookie('ganglia-selected-view-' + window.name, "");
+ $("#vn").val("");
+ });
+ }
} else
alert("Please select the view to delete");
});

0 comments on commit 6b7ebd7

Please sign in to comment.