]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
close websocket before unload
authorSeven Du <dujinfang@gmail.com>
Tue, 4 Jun 2013 02:23:23 +0000 (10:23 +0800)
committerTravis Cross <tc@traviscross.com>
Fri, 7 Jun 2013 04:57:47 +0000 (04:57 +0000)
htdocs/portal/index.html

index 9fbcef29636ad233c1bae3675bf3790f655f1fcc..2f1f9104d714b178a209dbb04716f8b6609f142d 100644 (file)
 -->
 <script type="text/javascript">
 
+       $(window).on('beforeunload', function() {
+               if (socket) {
+                       socket.close();
+               }
+       });
+
        function auto_update_calls() {
                var x = $('#auto_update_calls')[0];
                if (typeof x != "undefined" && x.checked) {