From f18ec599221cdf5598e44f9c62214decae7ebe78 Mon Sep 17 00:00:00 2001 From: Taka Date: Mon, 23 Jul 2018 11:25:59 +0000 Subject: [PATCH] Close growl notifications on ESCAPE. --- vasl_templates/webapp/static/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index 65ff8d9..cbbbec8 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -30,10 +30,14 @@ $(document).ready( function () { pos.left+$(this).width()+4, pos.top+$(this).height()+4, "fade", 200 ) ; } ) ; - // nb: we dismiss the popmenu on ESCAPE + // nb: we dismiss the popmenu and any notifications on ESCAPE $(document).keydown( function(evt) { - if ( evt.keyCode == 27 ) + if ( evt.keyCode == 27 ) { $menu.popmenu( "hide" ) ; + $(".growl-close").each( function() { + $(this).trigger( "click" ) ; + } ) ; + } } ) ; // add a handler for when the "load scenario" file has been selected $("#load-scenario").change( on_load_scenario_file_selected ) ;