From 202a875d40c48ed492b9c23b8a7e4195525ccd6f Mon Sep 17 00:00:00 2001 From: f0o Date: Thu, 23 Apr 2015 16:36:42 +0000 Subject: [PATCH] JS Update --- html/includes/print-alerts.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/html/includes/print-alerts.php b/html/includes/print-alerts.php index 778a87b71..645db93cb 100644 --- a/html/includes/print-alerts.php +++ b/html/includes/print-alerts.php @@ -40,23 +40,27 @@ var grid = $("#alerts").bootgrid({ templates: { } }).on("loaded.rs.jquery.bootgrid", function() { + grid.find(".incident-toggle").each( function() { + $(this).parent().addClass('incident-toggle-td'); + }).on("click", function(e) { + var target = $(this).data("target"); + $(target).collapse('toggle'); + $(this).toggleClass('glyphicon-plus glyphicon-minus'); + }); grid.find(".incident").each( function() { $(this).parent().addClass('col-md-12 col-sm-12 col-xs-12'); $(this).parent().parent().on("mouseenter", function() { $(this).find(".incident-toggle").fadeIn(200); }).on("mouseleave", function() { $(this).find(".incident-toggle").fadeOut(200); - }).on("click", function() { - var target = $(this).find(".incident-toggle").data("target"); - $(this).find(".incident-toggle").toggleClass('glyphicon-plus glyphicon-minus'); - $(target).collapse('toggle'); + }).on("click", "td:not(.incident-toggle-td)", function() { + var target = $(this).parent().find(".incident-toggle").data("target"); + if( $(this).parent().find(".incident-toggle").hasClass('glyphicon-plus') ) { + $(this).parent().find(".incident-toggle").toggleClass('glyphicon-plus glyphicon-minus'); + $(target).collapse('toggle'); + } }); }); - grid.find(".incident-toggle").on("click", function(e) { - var target = $(this).data("target"); - $(this).toggleClass('glyphicon-plus glyphicon-minus'); - $(target).collapse('toggle'); - }); grid.find(".command-ack-alert").on("click", function(e) { e.preventDefault(); var alert_id = $(this).data("alert_id");