diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index 0ccdcd88f4..492c3795e8 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -23,7 +23,7 @@ block content .alert.alert-warning.small(ng-if="connection.reconnection_countdown") strong #{translate("lost_connection")}. | #{translate("reconnecting_in_x_secs", {seconds:"{{ connection.reconnection_countdown }}"})}. - a.pull-right(href, ng-click="tryReconnectNow()") #{translate("try_now")} + a#try-reconnect-now-button.pull-right(href, ng-click="tryReconnectNow()") #{translate("try_now")} .alert.alert-warning.small(ng-if="connection.reconnecting") strong #{translate("reconnecting")}... diff --git a/services/web/public/coffee/ide/connection/ConnectionManager.coffee b/services/web/public/coffee/ide/connection/ConnectionManager.coffee index 8b17c97722..e6c9597f68 100644 --- a/services/web/public/coffee/ide/connection/ConnectionManager.coffee +++ b/services/web/public/coffee/ide/connection/ConnectionManager.coffee @@ -19,13 +19,12 @@ define [], () -> @$scope.tryReconnectNow = () => @tryReconnect() - @$scope.$on "editor:change", () => - @lastUpdated = new Date() + @$scope.$on 'cursor:editor:update', () => if !@connected @tryReconnect() - @$scope.$on 'cursor:editor:update', () => - if !@connected + document.querySelector('body').addEventListener 'click', (e) => + if !@connected and e.target.id != 'try-reconnect-now-button' @tryReconnect() @ide.socket = io.connect null,