]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure last seen tooltip always appears even after searching and filtering
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 19 Jun 2014 12:30:22 +0000 (14:30 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Thu, 19 Jun 2014 12:30:22 +0000 (14:30 +0200)
settings/css/settings.css
settings/js/users/users.js
settings/templates/users/part.userlist.php

index 906712a56ba8b1bb0300535ad303ed1346faad12..ef8428bd3ef5c11c847fffe4924442b3652776b7 100644 (file)
@@ -83,6 +83,7 @@ td.name, td.password { padding-left:.8em; }
 td.password>img,td.displayName>img, td.remove>a, td.quota>img { visibility:hidden; }
 td.password, td.quota, td.displayName { width:12em; cursor:pointer; }
 td.password>span, td.quota>span, rd.displayName>span { margin-right: 1.2em; color: #C7C7C7; }
+span.usersLastLoginTooltip { white-space: nowrap; }
 
 td.remove { width:1em; padding-right:1em; }
 tr:hover>td.password>span, tr:hover>td.displayName>span { margin:0; cursor:pointer; }
index a911225c5c5c5c85add8a44878bae8d178558136..1c0f3eef8404c6d7e0ed84dc9f394fe9874d5a0c 100644 (file)
@@ -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
index c74fdcc9efa4381177ea5c3dfd6afaebf856ff51..25b17275858ad032aff013f194df406eddc14338 100644 (file)
                        <?php
                        if($user["lastLogin"] === 0) {
                                $lastLogin = $l->t('never');
-                               $lastLoginDate = '';
+                               $lastLoginDate = $lastLogin;
                        } else {
                                $lastLogin = relative_modified_date($user["lastLogin"]);
                                $lastLoginDate = \OC_Util::formatDate($user["lastLogin"]);
                        }
                        ?>
-                       <td class="lastLogin" title="<?php p('<span style="white-space: nowrap;">'.$lastLoginDate.'</span>'); ?>"><?php p($lastLogin); ?></td>
+                       <td class="lastLogin" title="<?php p('<span class="usersLastLoginTooltip">'.$lastLoginDate.'</span>'); ?>"><?php p($lastLogin); ?></td>
                        <td class="remove">
                                <?php if($user['name']!=OC_User::getUser()):?>
                                        <a href="#" class="action delete" original-title="<?php p($l->t('Delete'))?>">