From 1f88d1f2ba1e304abe4cd20f0bd3aae9347f4be8 Mon Sep 17 00:00:00 2001 From: Nicolai Tellefsen Date: Wed, 23 Mar 2016 10:07:43 +0100 Subject: NMS: Fix comments not triggering after "tab" switching --- web/nms.gathering.org/js/nms-info-box.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'web/nms.gathering.org/js/nms-info-box.js') diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 304a8d9..623f6be 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -218,6 +218,7 @@ nmsInfoBox._windowTypes.switchInfo = { return this.childContent; }, showComments: function() { + var oldView = this.activeView; this.activeView = "comments"; var domObj = document.createElement("div"); var comments = []; @@ -233,7 +234,7 @@ nmsInfoBox._windowTypes.switchInfo = { this.commentsHash = false; // We have data, but its old, so don't change data - } else if(this.commentsHash != false && this.commentsHash == nmsData.comments.hash) { + } else if(oldView == "comments" && this.commentsHash != false && this.commentsHash == nmsData.comments.hash) { return; // We have data, refresh -- cgit v1.2.3 From f421bfcac59d211f334842adfc04e41f8a6585ea Mon Sep 17 00:00:00 2001 From: Nicolai Tellefsen Date: Wed, 23 Mar 2016 10:52:34 +0100 Subject: NMS: Fix comment hash-check logic --- web/nms.gathering.org/js/nms-info-box.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'web/nms.gathering.org/js/nms-info-box.js') diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 623f6be..0481420 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -233,10 +233,6 @@ nmsInfoBox._windowTypes.switchInfo = { if(!nmsData.comments || !nmsData.comments.comments) { this.commentsHash = false; - // We have data, but its old, so don't change data - } else if(oldView == "comments" && this.commentsHash != false && this.commentsHash == nmsData.comments.hash) { - return; - // We have data, refresh } else if(nmsData.comments.comments[this.sw]) { this.commentsHash = nmsData.comments.hash; @@ -333,9 +329,14 @@ nmsInfoBox._windowTypes.switchInfo = { nmsInfoBox.refresh(); }, unload: function() { - this.childContent = false; + this.title = ''; + this.content = ''; + this.childContent = false; + this.sw = ''; + this.swi = ''; + this.swm = ''; this.commentsHash = false; - this.activeView = ""; + this.activeView = ''; }, save: function() { var myData = nmsInfoBox._editStringify(this.sw); -- cgit v1.2.3