Skip to content

Commit f82dd19

Browse files
committed
Styling for sortable folders list
1 parent 4f24c14 commit f82dd19

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

program/js/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7818,7 +7818,6 @@ function rcube_webmail() {
78187818

78197819
// TODO: In the receive callback, can we wait for the confirmation dialog without introducing async/await and Promises?
78207820
// TODO: save only if the list is different than at start
7821-
// TODO: Fix the styling (padding)
78227821
this.make_folder_lists_sortable = () => {
78237822
const mainFolderList = this.gui_objects.subscriptionlist;
78247823
$folderLists = $('ul', mainFolderList.parentElement);

skins/elastic/styles/widgets/lists.less

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,40 @@ ul.treelist {
618618
&.menu a:before {
619619
margin-left: .5em;
620620
}
621+
622+
// Styles for the sortable list of folders in the settings.
623+
&.ui-sortable {
624+
// Using an ID here to overwrite the styles from other rules, which also use this ID as selector.
625+
&#subscription-table ul {
626+
// Make the sub-list overlay its parent element so an item that is visually hovering over the parent element is actually hovering over the sub-list and thus gets sorted into it.
627+
margin-top: -2rem;
628+
padding-top: 2rem;
629+
padding-bottom: 0;
630+
}
631+
632+
// Give the list items a little bit more space at top to counter the increased space required by the sub-lists at the bottom.
633+
li {
634+
padding-top: 0.5rem;
635+
}
636+
637+
li div.treetoggle {
638+
top: 0.5rem;
639+
}
640+
641+
.custom-control-label {
642+
top: 0.5rem;
643+
}
644+
645+
li ul li:first-child {
646+
margin-top: 0.5rem;
647+
}
648+
649+
// To counter the counter, give the first sub-list layer a small padding at the bottom to even out the increased margins/paddings at the top of the elements.
650+
&#subscription-table > li > ul {
651+
padding-bottom: 0.5rem;
652+
}
653+
654+
}
621655
}
622656

623657

0 commit comments

Comments
 (0)