diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-02-18 22:33:03 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-02-18 22:33:15 +0300 |
commit | 7d03e84ff46e63af83489533cf5a00a79f5f013c (patch) | |
tree | 5f38ec0eb192d6a875ec6bf71e6f236150b4ffea /ncp-web | |
parent | f1d41e38464697da8b7acd70e03a900061b477ba (diff) |
ncp-web: disable event handler after poweroffv0.46.18
Diffstat (limited to 'ncp-web')
-rw-r--r-- | ncp-web/ncp.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ncp-web/ncp.js b/ncp-web/ncp.js index 3937761a..327fcbd0 100644 --- a/ncp-web/ncp.js +++ b/ncp-web/ncp.js @@ -159,7 +159,7 @@ $(function() } ); // Power-off button - $( '#poweroff' ).on('click', function(e) + function poweroff_event_handler(e) { //e.preventBubble = true; $('#overlay').show(); @@ -170,7 +170,8 @@ $(function() $('#overlay').hide(); $('#overlay').off('click'); }); - }); + } + $( '#poweroff' ).on('click', poweroff_event_handler ); $( '#poweroff-option_shutdown' ).on('click', function(e) { @@ -182,6 +183,7 @@ $(function() function success( result ) { $('#config-box-wrapper').hide(); + $.off( poweroff_event_handler ); $('#config-box-title').fill( "Shutting down..." ); }).error( errorMsg ); } ); @@ -196,6 +198,7 @@ $(function() function success( result ) { $('#config-box-wrapper').hide(); + $.off( poweroff_event_handler ); $('#config-box-title').fill( "Rebooting..." ); }).error( errorMsg ); } ); |