From cf20e90cc63f81794e2f0b03ce1d2ef62aff58e2 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Mon, 12 Mar 2018 01:09:01 +0900 Subject: [PATCH] Improve session closing --- assets/shell.js | 7 ++++++- views/shell.handlebars | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/shell.js b/assets/shell.js index dc5ee8b..0136edb 100644 --- a/assets/shell.js +++ b/assets/shell.js @@ -2,9 +2,10 @@ $(document).ready(() => { let $shell = $("#shell"); - if (!$shell) { + if ($shell.length < 1) { return; } + let $close = $(".shell-close"); let closeTimeout = null; @@ -90,4 +91,8 @@ $(document).ready(() => { }, 2000); }); + $close.click(() => { + socket.disconnect(); + }); + }); diff --git a/views/shell.handlebars b/views/shell.handlebars index 6a760d3..76d972b 100644 --- a/views/shell.handlebars +++ b/views/shell.handlebars @@ -6,7 +6,7 @@