Skip to content

Commit 3f56d28

Browse files
committed
use data attribute for accessing serverId instead of picking it from class name
1 parent 3a25b6b commit 3f56d28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/advanced_search/js_modules/route_handlers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function applyAdvancedSearchPageHandlers() {
7272
size: 'lg',
7373
});
7474

75-
const serverId = $(this).closest('li').attr("class").split('_')[1];
75+
const serverId = $(this).closest('li').data('serverId');
7676
const specialFolders = [];
7777
['archive', 'draft', 'junk', 'sent', 'trash'].forEach(folderType => {
7878
const folderName = hm_special_folders()[serverId][folderType];

modules/imap/output_modules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ protected function output() {
880880
$res = '';
881881
if ($this->get('imap_folders')) {
882882
foreach ($this->get('imap_folders', array()) as $id => $folder) {
883-
$res .= '<li class="imap_'.$id.'_"><a href="#" class="imap_folder_link" data-target="imap_'.$id.'_">';
883+
$res .= '<li class="imap_'.$id.'_" data-server-id="' . $id . '"><a href="#" class="imap_folder_link" data-target="imap_'.$id.'_">';
884884
if (!$this->get('hide_folder_icons')) {
885885
$res .= '<i class="bi bi-folder me-2"></i>';
886886
}

0 commit comments

Comments
 (0)