diff options
| author | Luc Donnet | 2014-02-11 14:18:09 +0100 |
|---|---|---|
| committer | Luc Donnet | 2014-02-11 14:18:09 +0100 |
| commit | 4ca13ff49efc4adcb58158e81e302e9f02da3c4a (patch) | |
| tree | 742ffef94d1d1a6d8ffcdcf25ff8384362f39880 | |
| parent | 87c6c1260e31e4d2fd0ef5eed25313ad224d2664 (diff) | |
| download | chouette-core-4ca13ff49efc4adcb58158e81e302e9f02da3c4a.tar.bz2 | |
Fix popover to disappear when user click on the page
| -rw-r--r-- | app/views/compliance_check_results/index.js.coffee | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/views/compliance_check_results/index.js.coffee b/app/views/compliance_check_results/index.js.coffee index c73676d88..1fb12cf86 100644 --- a/app/views/compliance_check_results/index.js.coffee +++ b/app/views/compliance_check_results/index.js.coffee @@ -1,5 +1,14 @@ jQuery -> - $("body").popover({ selector: '.notice', container: "body", trigger: "click", html: true, placement: "bottom" }) + $(".notice").popover({ container: "body", trigger: "click", html: false, placement: "bottom" }) + + $("body").click (e) -> + $(".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( $(this).data('bs.popover').tip().hasClass('in') ) + $(this).popover('toggle'); + return # Hide and show error details $(".title_error").each -> |
