Quicksand - make notification and message counts update as you navigate around

Summary: Ref T7573. Unify code to fetch these counts and do some light formatting since we're going to need to do the same thing for some conpherence-specific ajax in the durable column (See T7708).

Test Plan: loaded up two tabs, one with a durable column on and one without. in the without browser, i read some messages, decrementing my unread count. when i navigated again in the durable column browser, the count updated correctly. with no notifications, commented on a task with another user to get a notification and it showed up properly. visited the task by clicking not the notification and the bubble count decremented correctly

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7573

Differential Revision: https://secure.phabricator.com/D12498
This commit is contained in:
Bob Trahan
2015-04-21 15:46:36 -07:00
parent c509e80a74
commit dd9ec255ec
7 changed files with 185 additions and 50 deletions

View File

@@ -192,7 +192,7 @@ JX.install('Quicksand', {
// If it's the current page, draw it into the browser. It might not be
// the current page if the user already clicked another link.
if (self._current == id) {
self._draw();
self._draw(true);
}
},
@@ -203,7 +203,7 @@ JX.install('Quicksand', {
* After a navigation event or the arrival of page content, we paint it
* onto the page.
*/
_draw: function() {
_draw: function(from_server) {
var self = JX.Quicksand;
if (self._onpage == self._current) {
@@ -234,7 +234,8 @@ JX.install('Quicksand', {
null,
{
newResponse: self._responses[self._current],
oldResponse: self._responses[self._onpage]
oldResponse: self._responses[self._onpage],
fromServer: from_server
});
self._onpage = self._current;
@@ -278,7 +279,7 @@ JX.install('Quicksand', {
}
// Redraw the page.
self._draw();
self._draw(false);
}
},