Skip to content

Commit 0c0264b

Browse files
Merge pull request #4450 from corentin-soriano/improve_clickable_area
Improve clickable area on the item list.
2 parents fdabcdd + 4da8402 commit 0c0264b

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

includes/css/teampass.css

+17
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@
6969

7070
.list-item-description {
7171
position: relative;
72+
height: 50px;
73+
width: 100%;
74+
line-height: 50px;
75+
}
76+
77+
.list-item-clicktoshow .user-fa-icon,
78+
.list-item-description .dragndrop {
79+
line-height: 50px;
80+
}
81+
82+
.list-item-clicktoshow.d-inline-flex {
83+
max-width: 100%;
84+
flex: 1;
85+
}
86+
87+
.list-item-row-description-extend {
88+
flex: 1;
7289
}
7390

7491
.list-item-actions {

pages/items.js.php

+10-7
Original file line numberDiff line numberDiff line change
@@ -4320,12 +4320,12 @@ function(teampassApplication) {
43204320
description = (value.desc.replace(/<.*>/gi, '').trim() !== '' ? '<i>'+itemLabel + '</i><i class="fa-solid fa-heading mr-1 ml-2"></i>' + value.desc : '<i>'+itemLabel + '</i>');
43214321
// Consolidate item label
43224322
if (description !== '') {
4323-
description = '<span class="text-secondary small">' + description + '</span>';
4323+
description = '<span class="text-secondary small d-inline-block text-truncate">' + description + '</span>';
43244324
}
43254325

43264326
$('#teampass_items_list').append(
43274327
'<tr class="list-item-row' + (value.canMove === 1 ? ' is-draggable' : '') + ((store.get('teampassApplication').highlightFavorites === 1 && value.is_favourited === 1) ? ' bg-yellow' : '') + '" id="list-item-row_' + value.item_id + '" data-item-key="' + value.item_key + '" data-item-edition="' + value.open_edit + '" data-item-id="' + value.item_id + '" data-item-sk="' + value.sk + '" data-item-expired="' + value.expired + '" data-item-rights="' + value.rights + '" data-item-display="' + value.display + '" data-item-open-edit="' + value.open_edit + '" data-item-tree-id="' + value.tree_id + '" data-is-search-result="' + value.is_result_of_search + '" data-label="' + escape(value.label) + '">' +
4328-
'<td class="list-item-description" style="width: 100%;">' +
4328+
'<td class="list-item-description px-3 py-0 align-middle d-flex">' +
43294329
// Show user a grippy bar to move item
43304330
(value.canMove === 1 ? '<i class="fa-solid fa-ellipsis-v mr-2 dragndrop"></i>' : '') + //&& value.is_result_of_search === 0
43314331
// Show user a ban icon if expired
@@ -4334,11 +4334,12 @@ function(teampassApplication) {
43344334
(value.rights === 10 ? '<i class="fa-regular fa-eye-slash fa-xs mr-2 text-primary infotip" title="<?php echo $lang->get('item_with_restricted_access'); ?>"></i>' : '') +
43354335
// Show user that password is badly encrypted
43364336
(value.pw_status === 'encryption_error' ? '<i class="fa-solid fa-exclamation-triangle fa-xs text-danger infotip mr-1" title="<?php echo $lang->get('pw_encryption_error'); ?>"></i>' : '') +
4337-
// Show item fa_icon if set
4338-
(value.fa_icon !== '' ? '<i class="'+value.fa_icon+' mr-1"></i>' : '') +
43394337
// Prepare item info
4340-
'<span class="list-item-clicktoshow' + (value.rights === 10 ? '' : ' pointer') + '" data-item-id="' + value.item_id + '" data-item-key="' + value.item_key + '">' +
4341-
'<span class="list-item-row-description' + (value.rights === 10 ? ' font-weight-light' : '') + '"><i class="item-favorite-star fa-solid' + ((store.get('teampassApplication').highlightFavorites === 1 && value.is_favourited === 1) ? ' fa-star mr-1' : '') + '"></i>' + value.label + '</span>' + (value.rights === 10 ? '' : description) +
4338+
'<span class="list-item-clicktoshow d-inline-flex' + (value.rights === 10 ? '' : ' pointer') + '" data-item-id="' + value.item_id + '" data-item-key="' + value.item_key + '">' +
4339+
// Show item fa_icon if set
4340+
(value.fa_icon !== '' ? '<i class="'+value.fa_icon+' mr-1 user-fa-icon"></i>' : '') +
4341+
'<span class="list-item-row-description d-inline-block' + (value.rights === 10 ? ' font-weight-light' : '') + '"><i class="item-favorite-star fa-solid' + ((store.get('teampassApplication').highlightFavorites === 1 && value.is_favourited === 1) ? ' fa-star mr-1' : '') + '"></i>' + value.label + '</span>' + (value.rights === 10 ? '' : description) +
4342+
'<span class="list-item-row-description-extend"></span>' +
43424343
'</span>' +
43434344
'<span class="list-item-actions hidden">' +
43444345
(value.rights === 10 ?
@@ -6484,7 +6485,9 @@ function prepareFolderDragNDrop()
64846485
$(this).addClass('bg-warning');
64856486
},
64866487
helper: function(event) {
6487-
return $('<div class="bg-gray p-2 font-weight-light">' + $(this).find('.list-item-row-description').text() + '</div>');
6488+
return $('<div>')
6489+
.addClass('bg-gray p-2 font-weight-light')
6490+
.text($(this).find('.list-item-row-description').text());
64886491
}
64896492
});
64906493
$('.folder').droppable({

0 commit comments

Comments
 (0)