Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit 8492980

Browse files
committed
this fixes #197
1 parent e35f6b1 commit 8492980

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

js/info.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,13 @@ function targetUrlChangeHandler() {
331331

332332
/******************************************************************************/
333333

334+
function prepareToDie() {
335+
changeValueHandler($('#max-logged-requests'), 'maxLoggedRequests', 0, 999);
336+
$('input,button,select').off();
337+
}
338+
339+
/******************************************************************************/
340+
334341
// Handle user interaction
335342

336343
$(function(){
@@ -351,9 +358,10 @@ $(function(){
351358
$('#refresh-requests').on('click', renderRequests);
352359
$('input[id^="show-"][type="checkbox"]').on('change', changeFilterHandler);
353360
$('#selectPageUrls').on('change', targetUrlChangeHandler);
354-
$('#max-logged-requests').on('change', function(){
355-
changeValueHandler($(this), 'maxLoggedRequests', 0, 999);
356-
});
361+
$('#max-logged-requests').on('change', function(){ changeValueHandler($(this), 'maxLoggedRequests', 0, 999); })
362+
363+
// https://github.com/gorhill/httpswitchboard/issues/197
364+
$(window).one('beforeunload', prepareToDie);
357365

358366
renderTransientData(true);
359367
renderRequests();

0 commit comments

Comments
 (0)