From 30a0dc02b0d12f1d1b63ab8bef94c18819e74945 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 18 2015 11:04:27 +0000 Subject: Let's try to close the eventsource connection before closing the page --- diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index 5cd8999..7d4bd1a 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -329,12 +329,17 @@ $(function() { }); +var source = null; if (!!window.EventSource) { - var source = new EventSource('{{ + source = new EventSource('{{ url_for("stream_issue", username=username, repo=repo.name, issueid=issueid) }}'); } +window.onbeforeunload = function() { + source.close() +}; + clean_entry= function(text, element){ var _data = $.trim(text).split(','); var _out = []