From 1d6ccc99a1cd8e35af109b1b764287372cc689f2 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 3 Mar 2016 18:04:14 +0100 Subject: [PATCH] add 'onAbort' hook to realtime-input.js --- www/common/realtime-input.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/common/realtime-input.js b/www/common/realtime-input.js index e4ddf16e6..394670f53 100644 --- a/www/common/realtime-input.js +++ b/www/common/realtime-input.js @@ -105,6 +105,7 @@ define([ // bind abort to onLeaving var abort = function (socket, realtime) { realtime.abort(); + realtime.toolbar.failed(); try { socket._socket.close(); } catch (e) { warn(e); } }; @@ -159,7 +160,7 @@ define([ var transformFunction = config.transformFunction || null; var socket; - + if (config.socketAdaptor) { // do netflux stuff } else { @@ -293,6 +294,11 @@ define([ if (recoverableErrorCount >= MAX_RECOVERABLE_ERRORS) { warn("Giving up!"); abort(socket, realtime); + if (config.onAbort) { + config.onAbort({ + socket + }); + } if (socketChecker) { clearInterval(socketChecker); } } } else {