Browse Source

[notification] refresh on session_alive

version-14
Rushabh Mehta 12 years ago
parent
commit
eeee81de6f
2 changed files with 8 additions and 0 deletions
  1. +5
    -0
      public/js/wn/app.js
  2. +3
    -0
      public/js/wn/misc/user.js

+ 5
- 0
public/js/wn/app.js View File

@@ -100,6 +100,11 @@ wn.Application = Class.extend({
// first time loaded in boot // first time loaded in boot
$(document).trigger("notification-update"); $(document).trigger("notification-update");
// refresh notifications if user is back after sometime
$(document).on("session_alive", function() {
me.refresh_notifications();
})
}, },
refresh_notifications: function() { refresh_notifications: function() {


+ 3
- 0
public/js/wn/misc/user.js View File

@@ -122,6 +122,9 @@ $.extend(wn.user, {


wn.session_alive = true; wn.session_alive = true;
$(document).bind('mousemove', function() { $(document).bind('mousemove', function() {
if(wn.session_alive===false) {
$(document).trigger("session_alive");
}
wn.session_alive = true; wn.session_alive = true;
if(wn.session_alive_timeout) if(wn.session_alive_timeout)
clearTimeout(wn.session_alive_timeout); clearTimeout(wn.session_alive_timeout);


Loading…
Cancel
Save