diff options
| author | Ed Tanous <ed.tanous@intel.com> | 2017-04-03 09:47:01 -0700 |
|---|---|---|
| committer | Ed Tanous <ed.tanous@intel.com> | 2017-04-03 09:47:01 -0700 |
| commit | 8041f31acacc8404f13b1302bf9030bc047cf452 (patch) | |
| tree | c80a1be66557106bd46b193ae3521b06bbc1875d /static/js | |
| parent | b4d29f40923bd2d6af2666e10109469a9e557493 (diff) | |
| download | bmcweb-8041f31acacc8404f13b1302bf9030bc047cf452.tar.gz bmcweb-8041f31acacc8404f13b1302bf9030bc047cf452.zip | |
incremental
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/kvmController.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/static/js/kvmController.js b/static/js/kvmController.js index e3dcb14..4f692f1 100644 --- a/static/js/kvmController.js +++ b/static/js/kvmController.js @@ -33,8 +33,6 @@ function($scope, $location, $window) { return; // don't continue trying to connect }; - - $scope.$on("$destroy", function() { if (rfb) { rfb.disconnect(); @@ -63,6 +61,14 @@ function($scope, $location, $window) { }; function status(text, level) { + var status_bar = angular.element(document.querySelector('#noVNC_status_bar'))[0]; + // Need to check if the status bar still exists. On page change, it gets destroyed + // when we swap to a different view. The system will disconnect async + if (status_bar){ + status_bar.textContent = text; + } + + var status = angular.element(document.querySelector('#noVNC_status'))[0]; switch (level) { case 'normal': case 'warn': @@ -71,8 +77,9 @@ function($scope, $location, $window) { default: level = "warn"; } - angular.element(document.querySelector('#noVNC_status'))[0].textContent = text; - angular.element(document.querySelector('#noVNC_status_bar'))[0].setAttribute("class", "noVNC_status_" + level); + if (status){ + status.setAttribute("class", "noVNC_status_" + level); + } }; function updateState(rfb, state, oldstate) { |

