diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-06-19 14:30:22 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-06-19 14:30:22 +0200 |
commit | 85894654ae5dfa004fd29d876b49e32cab03b7c2 (patch) | |
tree | b202333773525c6ad7fb600f2ce37e90411bea20 /settings/js | |
parent | e1fd10f22697383a4a1c2eba4e9ec4fdd9d3f841 (diff) | |
download | nextcloud-server-85894654ae5dfa004fd29d876b49e32cab03b7c2.tar.gz nextcloud-server-85894654ae5dfa004fd29d876b49e32cab03b7c2.zip |
Make sure last seen tooltip always appears even after searching and filtering
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/users/users.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index a911225c5c5..1c0f3eef840 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -80,13 +80,23 @@ var UserList = { } } $tr.find('td.storageLocation').text(storageLocation); + if(lastLogin === 0) { - lastLogin = t('settings', 'never'); + var lastLoginRel = t('settings', 'never'); + var lastLoginAbs = lastLoginRel; } else { lastLogin = new Date(lastLogin * 1000); - lastLogin = relative_modified_date(lastLogin.getTime() / 1000); + var lastLoginRel = relative_modified_date(lastLogin.getTime() / 1000); + var lastLoginAbs = formatDate(lastLogin.getTime()); } - $tr.find('td.lastLogin').text(lastLogin); + $tdLastLogin = $tr.find('td.lastLogin'); + $tdLastLogin.text(lastLoginRel); + //tooltip makes it complicated … to not insert new HTML, we adjust the + //original title. We use a temporary div to get back the html that we + //can pass later. It is also required to initialise tipsy. + var tooltip = $('<div>').html($($tdLastLogin.attr('original-title')).text(lastLoginAbs)).html(); + $tdLastLogin.tipsy({gravity:'s', fade:true, html:true}); + $tdLastLogin.attr('title', tooltip); $tr.appendTo($userList); if(UserList.isEmpty === true) { //when the list was emptied, one row was left, necessary to keep |