Skip to content

Commit f62a353

Browse files
committed
fix(backend): add icons to folders links & expand folders list automatically
1 parent 061e2fb commit f62a353

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

modules/imap_folders/modules.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ protected function output() {
409409
if ($this->get('folder_server') !== NULL) {
410410
$res = '<div class="row m-0 px-3 mt-3">';
411411
$res .= '<div data-target=".delete_dialog" class="settings_subtitle col-12 border-bottom px-0">
412-
<a href="#" class="pe-auto">'.$this->trans('Delete a Folder').'</a>
412+
<a href="#" class="pe-auto"><i class="bi bi-folder-x fs-5 me-2"></i>'.$this->trans('Delete a Folder').'</a>
413413
</div>';
414414
$res .= '<div class="delete_dialog folder_dialog col-lg-4 col-md-6 col-sm-12 py-1 px-0">
415415
<div class="folder_row">
@@ -439,7 +439,7 @@ protected function output() {
439439
if ($this->get('folder_server') !== NULL) {
440440
$res = '<div class="row m-0 px-3 mt-3">
441441
<div data-target=".rename_dialog" class="settings_subtitle col-12 border-bottom px-0">
442-
<a href="#" class="pe-auto">'.$this->trans('Rename a Folder').'</a>
442+
<a href="#" class="pe-auto"><i class="bi bi-folder-check fs-5 me-2"></i>'.$this->trans('Rename a Folder').'</a>
443443
</div>
444444
<div class="rename_dialog folder_dialog col-lg-4 col-md-6 col-sm-12 py-3 px-0">
445445
<div class="folder_row">
@@ -493,7 +493,7 @@ protected function output() {
493493

494494
$res = '<div class="row m-0 px-3 mt-3">';
495495
$res .= '<div data-target=".sent_folder_dialog" class="settings_subtitle col-12 border-bottom px-0">
496-
<a href="#" class="pe-auto">'.$this->trans('Sent Folder').':<span id="sent_val">'.$folder_name.'</span></a>
496+
<a href="#" class="pe-auto"><i class="bi bi-send-check-fill fs-5 me-2"></i>'.$this->trans('Sent Folder').':<span id="sent_val">'.$folder_name.'</span></a>
497497
</div>';
498498
$res .= '<div class="folder_dialog sent_folder_dialog col-lg-6 col-md-6 col-sm-12 py-3 px-0">
499499
<div class="folder_row">
@@ -539,7 +539,7 @@ protected function output() {
539539

540540
$res = '<div class="row m-0 px-3 mt-3">';
541541
$res .= '<div data-target=".archive_folder_dialog" class="settings_subtitle col-12 border-bottom px-0">
542-
<a href="#" class="pe-auto">'.$this->trans('Archive Folder').':<span id="archive_val">'.$folder_name.'</span></a>
542+
<a href="#" class="pe-auto"><i class="bi bi-archive fs-5 me-2"></i>'.$this->trans('Archive Folder').':<span id="archive_val">'.$folder_name.'</span></a>
543543
</div>';
544544
$res .= '<div class="folder_dialog archive_folder_dialog col-lg-6 col-md-6 col-sm-12 py-3 px-0">
545545
<div class="folder_row">
@@ -585,7 +585,7 @@ protected function output() {
585585

586586
$res = '<div class="row m-0 px-3 mt-3">';
587587
$res .= '<div data-target=".draft_folder_dialog" class="settings_subtitle col-12 border-bottom px-0">
588-
<a href="#" class="pe-auto">'.$this->trans('Draft Folder').':<span id="draft_val">'.$folder_name.'</span></a>
588+
<a href="#" class="pe-auto"><i class="bi bi-pencil-square fs-5 me-2"></i>'.$this->trans('Draft Folder').':<span id="draft_val">'.$folder_name.'</span></a>
589589
</div>';
590590
$res .= '<div class="folder_dialog draft_folder_dialog col-lg-6 col-md-6 col-sm-12 py-3 px-0">
591591
<div class="folder_row">
@@ -631,7 +631,7 @@ protected function output() {
631631

632632
$res = '<div class="row m-0 px-3 mt-3">';
633633
$res .= '<div data-target=".trash_folder_dialog" class="settings_subtitle col-12 border-bottom px-0">
634-
<a href="#" class="pe-auto">'.$this->trans('Trash Folder').':<span id="trash_val">'.$folder_name.'</span></a>
634+
<a href="#" class="pe-auto"><i class="bi bi-trash3 fs-5 me-2"></i>'.$this->trans('Trash Folder').':<span id="trash_val">'.$folder_name.'</span></a>
635635
</div>';
636636
$res .= '<input type="hidden" id="not_set_string" value="'.$this->trans('Not set').'" />';
637637
$res .= '<div class="folder_dialog trash_folder_dialog col-lg-6 col-md-6 col-sm-12 py-3 px-0">
@@ -674,7 +674,7 @@ protected function output() {
674674

675675
$res = '<div class="row m-0 px-3 mt-3">';
676676
$res .= '<div data-target=".junk_folder_dialog" class="settings_subtitle col-12 border-bottom px-0">
677-
<a href="#" class="pe-auto">'.$this->trans('Junk Folder').':<span id="junk_val">'.$folder_name.'</span></a>
677+
<a href="#" class="pe-auto"><i class="bi bi-envelope-x-fill fs-5 me-2"></i>'.$this->trans('Junk Folder').':<span id="junk_val">'.$folder_name.'</span></a>
678678
</div>';
679679

680680
$res .= '<input type="hidden" id="not_set_string" value="'.$this->trans('Not set').'" />';
@@ -748,7 +748,7 @@ protected function output() {
748748
if ($this->get('folder_server') !== NULL) {
749749
$res = '<div class="row m-0 px-3 mt-3">
750750
<div data-target=".create_dialog" class="settings_subtitle col-12 border-bottom px-0">
751-
<a href="#" class="pe-auto">'.$this->trans('Create a New Folder').'</a>
751+
<a href="#" class="pe-auto"><i class="bi bi-folder-plus fs-5 me-2"></i>'.$this->trans('Create a New Folder').'</a>
752752
</div>
753753
<div class="create_dialog folder_dialog col-lg-4 col-md-6 col-sm-12 py-3 px-0">
754754
<div class="form-floating mb-3">

modules/imap_folders/site.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* .folder_dialog { margin-left: 40px; margin-top: 10px; margin-bottom: 30px; } */
22
/* .folder_dialog input { display: inline-block; margin-top: 15px; } */
33
.sent_folder_select, .draft_folder_select, .trash_folder_select, .folder_dialog, .delete_folder_select, .rename_folder_select, .rename_parent_folder_select, .parent_folder_select, .archive_folder_select, .junk_folder_select { display: none; }
4-
.draft_folder_select, .sent_folder_select, .trash_folder_select, .delete_folder_select, .rename_folder_select, .rename_parent_folder_select, .parent_folder_select, .archive_folder_select { width: 215px; position: absolute; background-color: #fff; padding: 15px; border: solid 1px #ede8e6; font-weight: normal; padding-left: 10px; min-width: 55px; padding-top: 10px; margin-left: 0px !important; margin-top: 0px; }
4+
.draft_folder_select, .sent_folder_select, .trash_folder_select, .delete_folder_select, .rename_folder_select, .rename_parent_folder_select, .parent_folder_select, .archive_folder_select { width: fit-content; position: absolute; background-color: #fff; padding: 15px; border: solid 1px #ede8e6; font-weight: normal; padding-left: 10px; min-width: 55px; padding-top: 10px; margin-left: 0px !important; margin-top: 0px; }
55
.delete_folder_select, .rename_folder_select, .rename_parent_folder_select, .sent_folder_select, .archive_folder_select, .draft_folder_select, .trash_folder_select, .junk_folder_select, .parent_folder_select { z-index: 10; }
66
.folder_row { margin-top: 15px; }
77
.close { margin-left: 10%; font-size: 100%; color: teal !important; }

modules/imap_folders/site.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var folder_page_folder_list = function(container, title, link_class, target, id_
1919
$('#'+id_dest).val('');
2020
return false;
2121
});
22+
expand_folders_page_list(child_link_target, container, link_class, target, id_dest, subscription, original_icon_clone, link);
2223
return false;
2324
};
2425

@@ -48,6 +49,15 @@ var expand_folders_page_list = function(path, container, link_class, target, id_
4849
$('.folder_subscription').on("change", function() { folder_subscribe(this.id, $('#'+this.id).is(':checked')); return false; });
4950
}
5051
}
52+
if(original_icon != null) {
53+
// 5. Restore the icon by removing the spinner element
54+
const spinner_element = document.getElementById('imap-spinner');
55+
if (spinner_element && spinner_element.parentNode === parent_icon_link) {
56+
if(parent_icon_link != null) {
57+
parent_icon_link.replaceChild(original_icon, spinner_element);
58+
}
59+
}
60+
}
5161
}
5262
);
5363
}

0 commit comments

Comments
 (0)