Skip to content

Commit fb93efe

Browse files
author
Dave Conway-Jones
committed
try not to activate popup when not visible
1 parent cc6663a commit fb93efe

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

dist/dashboard.appcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ weather-icons-lite/fonts/weather-icons-lite.woff2
1818
NETWORK:
1919
*
2020

21-
# hash: 3cdadf67e539c60570559fb3748c6e7669a2765d114b7145592fe131562325d8
21+
# hash: aa1028a4cc00955e9c5a35047cf37daa8ca3c5595b70ecc1ff87bee867d7a7e6

dist/js/app.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ if (!String.prototype.startsWith) {
3131
};
3232
}
3333

34+
var doVisualUpdates = true;
35+
document.addEventListener('visibilitychange', function() {
36+
doVisualUpdates = !document.hidden;
37+
});
38+
3439
var app = angular.module('ui',['ngMaterial', 'ngMdIcons', 'ngSanitize', 'ngTouch', 'sprintf', 'chart.js', 'color.picker']);
3540

3641
var locale = (navigator.languages && navigator.languages.length) ? navigator.languages[0] : navigator.language;
@@ -489,7 +494,7 @@ app.controller('MainController', ['$mdSidenav', '$window', 'UiEvents', '$locatio
489494
});
490495

491496
events.on('disconnect', function(m) {
492-
if (!disc) {
497+
if (!disc && doVisualUpdates) {
493498
$mdToast.show({
494499
template: '<md-toast><div class="md-toast-error">&#x2718; &nbsp; Connection lost</div></md-toast>',
495500
position: 'top right',

0 commit comments

Comments
 (0)