aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2014-02-14 09:39:17 +0100
committerLuc Donnet2014-02-14 09:39:17 +0100
commit60de5c8f1770612a08d04cdab021ed18c82b292e (patch)
treecc3f3e06b0304cfb36298287a4679e60c724d348
parenta08d960fb1494776b7bf61692281b3c747679c28 (diff)
downloadchouette-core-60de5c8f1770612a08d04cdab021ed18c82b292e.tar.bz2
Fix javascript on click event propagation
-rw-r--r--app/views/compliance_check_results/index.js.coffee5
-rw-r--r--app/views/compliance_check_tasks/show.js.coffee17
2 files changed, 7 insertions, 15 deletions
diff --git a/app/views/compliance_check_results/index.js.coffee b/app/views/compliance_check_results/index.js.coffee
index 1fb12cf86..203e2ca8e 100644
--- a/app/views/compliance_check_results/index.js.coffee
+++ b/app/views/compliance_check_results/index.js.coffee
@@ -5,10 +5,9 @@ jQuery ->
$(".notice").each ->
#the 'is' for buttons that trigger popups
#the 'has' for icons within a button that triggers a popup
- if not $(this).is(e.target) and $(this).has(e.target).length is 0 and $(".popover").has(e.target).length is 0
+ if not $(this).is(e.target) and $(this).has(e.target).length is 0 and $(".popover").has(e.target).length is 0
if( $(this).data('bs.popover').tip().hasClass('in') )
- $(this).popover('toggle');
- return
+ $(this).popover('toggle')
# Hide and show error details
$(".title_error").each ->
diff --git a/app/views/compliance_check_tasks/show.js.coffee b/app/views/compliance_check_tasks/show.js.coffee
index b5deabe4b..5a6073e23 100644
--- a/app/views/compliance_check_tasks/show.js.coffee
+++ b/app/views/compliance_check_tasks/show.js.coffee
@@ -3,19 +3,16 @@ jQuery ->
get_compliance_check_results = (html_container, status, severity) ->
h = new Object()
h["status"] = status if status
- h["severity"] = severity if severity
+ h["severity"] = severity if severity
+
$.get(
"<%= @compliance_check_task.id %>/compliance_check_results",
h,
- update = (data) ->
- html_container.append(data)
+ update = (data) ->
+ html_container.empty()
+ html_container.append(data)
)
- order_change = (event) ->
- console.log "order change"
-
- $('.compliance_check_tasks.show .order').change(order_change)
-
Morris.Donut({
element: 'error',
data: [
@@ -25,7 +22,6 @@ jQuery ->
]
colors: [ "#e22b1b", "#898e7f", "#8fc861" ]
}).on('click', update = (i, row) ->
- $(".report").empty()
switch i
when 0 then get_compliance_check_results( $(".report"), "nok", "error")
when 1 then get_compliance_check_results( $(".report"), "na", "error")
@@ -41,7 +37,6 @@ jQuery ->
]
colors: [ "#ffbd2b", "#898e7f", "#8fc861" ]
}).on('click', update = (i, row) ->
- $(".report").empty()
switch i
when 0 then get_compliance_check_results( $(".report"), "nok", "warning")
when 1 then get_compliance_check_results( $(".report"), "na", "warning")
@@ -49,11 +44,9 @@ jQuery ->
else console.log "Error no other value for donut chart")
$(".resume .col1 .caption").click ->
- $(".report").empty()
get_compliance_check_results( $(".report"), null, "error")
$(".resume .col2 .caption").click ->
- $(".report").empty()
get_compliance_check_results( $(".report"), null, "warning")
$('img[title]').tipsy({gravity: 'w'})