This commit is contained in:
6d486f49
2026-08-14 15:56:17 -04:00
parent af64b9e95c
commit 09a8adfc4a
827 changed files with 65045 additions and 71849 deletions
+22
View File
@@ -0,0 +1,22 @@
window.networkStatus = {
dotNetHelper: null,
initialize: function (dotNetHelper) {
this.dotNetHelper = dotNetHelper;
window.addEventListener('online', this.handleStatusChange.bind(this));
window.addEventListener('offline', this.handleStatusChange.bind(this));
return navigator.onLine;
},
handleStatusChange: function () {
if (this.dotNetHelper) {
this.dotNetHelper.invokeMethodAsync('SetOnlineStatus', navigator.onLine);
}
},
isOnline: function () {
return navigator.onLine;
},
dispose: function () {
window.removeEventListener('online', this.handleStatusChange.bind(this));
window.removeEventListener('offline', this.handleStatusChange.bind(this));
this.dotNetHelper = null;
}
};