mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 01:03:31 +02:00
fixes #2383 add custom ellipsis to show end of long album names
This commit is contained in:
@@ -164,6 +164,11 @@
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.search-result-path.not-rtl {
|
||||
direction: ltr !important;
|
||||
text-overflow: unset !important;
|
||||
}
|
||||
|
||||
.search-result-path-name {
|
||||
unicode-bidi: plaintext;
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ class AlbumSelector {
|
||||
|
||||
AlbumSelector.selectors.searchResult.append(
|
||||
`<div class='search-result-item' id="${cat.id}">
|
||||
<span class="search-result-path">${cat_name}</span><span id="${cat.id}" class="${iconAlbum} item-add"></span>
|
||||
<span class="search-result-path not-rtl">${this.#getEllipsisName(cat_name)}</span><span id="${cat.id}" class="${iconAlbum} item-add"></span>
|
||||
</div>`
|
||||
);
|
||||
|
||||
@@ -572,6 +572,10 @@ class AlbumSelector {
|
||||
!this.#isAlbumCreationChecked && this.#loadFillResultEvent(tempSelectedCat);
|
||||
}
|
||||
|
||||
#getEllipsisName(str, lenght = 50) {
|
||||
if (str.length <= lenght) return str;
|
||||
return '...' + str.slice(-lenght).trim();
|
||||
}
|
||||
/*-----------
|
||||
Ajax method
|
||||
-----------*/
|
||||
|
||||
Reference in New Issue
Block a user