diff --git a/app/assets/javascripts/clientUpdate.js b/app/assets/javascripts/clientUpdate.js index 04a45e3dd..97a798637 100644 --- a/app/assets/javascripts/clientUpdate.js +++ b/app/assets/javascripts/clientUpdate.js @@ -12,6 +12,13 @@ // updated once a download is started var updateSize = 0; + function cancelUpdate(e) { + if(e.ctrlKey && e.keyCode == 27) { + console.log("update canceled!"); + $('#client_update').hide(); + $('#client_update_overlay').hide(); + } + } // responsible for updating the contents of the update dialog // as well as registering for any event handlers @@ -21,8 +28,13 @@ $('#client_update .dialog-inner').html(templateHtml); + $('#client_update').attr('data-mode', templateId); + // assign click handlers if(templateId == "update-start") { + + $('body').on('keyup', cancelUpdate); + $("#client_update a.close-application").click(function() { // noop atm return false; @@ -34,6 +46,9 @@ }) } else if(templateId == "update-downloading") { + + $('body').off('keyup', cancelUpdate); + $("#client_update a.close-application").click(function() { // noop atm return false;