You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a suggested enhancement than a bug really. I would like to be able to reset the timestamp. I'm using timeago to display the length of time until the user's session times out - when the user acts to extend the session I would like to extend the timestamp.
Here is my implementation:
$.fn.timeago = function(timestamp, text) {
var self = this;
if (timestamp) { // Reset the timestamp.
self.removeData("timeago")
.html(text && text.length > 0 ? text : "")
.attr("title", timestamp);
}
self.each(refresh);
var $s = $t.settings;
if ($s.refreshMillis > 0) {
setInterval(function() { self.each(refresh); }, $s.refreshMillis);
} // For now just keep spawning extra timers...
return self;
};
astute observers may notice that every time this method is used it spawns an extra timer. I couldn't think of a quick way to fix that issue and it's unlikely to cause problems in my particular situation.
Besides... Calling timeago multiple times on the same element has the same effect (I think).
The text was updated successfully, but these errors were encountered:
This is more of a suggested enhancement than a bug really. I would like to be able to reset the timestamp. I'm using timeago to display the length of time until the user's session times out - when the user acts to extend the session I would like to extend the timestamp.
Here is my implementation:
astute observers may notice that every time this method is used it spawns an extra timer. I couldn't think of a quick way to fix that issue and it's unlikely to cause problems in my particular situation.
Besides... Calling timeago multiple times on the same element has the same effect (I think).
The text was updated successfully, but these errors were encountered: