Offline mode: Handle clicking on users/battles

Fixes #639
This commit is contained in:
Guangcong Luo
2016-02-16 20:38:27 -05:00
parent 5ca5448ed2
commit 4830b29051
2 changed files with 13 additions and 1 deletions

View File

@@ -846,6 +846,10 @@
app.addPopup(CreditsPopup);
},
finduser: function () {
if (app.isDisconnected) {
app.addPopupMessage("You are offline.");
return;
}
app.addPopupPrompt("Username", "Open", function (target) {
if (!target) return;
if (toId(target) === 'zarel') {

View File

@@ -95,6 +95,10 @@
this.close();
},
finduser: function () {
if (app.isDisconnected) {
app.addPopupMessage("You are offline.");
return;
}
app.addPopupPrompt("Username", "Open", function (target) {
if (!target) return;
if (toId(target) === 'zarel') {
@@ -155,7 +159,11 @@
},
update: function (data) {
if (!data && !this.data) {
this.$list.html('<p>Loading...</p>');
if (app.isDisconnected) {
this.$list.html('<p>You are offline.</p>');
} else {
this.$list.html('<p>Loading...</p>');
}
return;
}
this.$('button[name=refresh]')[0].disabled = false;