Skip to content

Commit

Permalink
fix(frontend/backend): suppress php warnings for the combined message…
Browse files Browse the repository at this point in the history
… list view and correct the search event triggered on the search input for each mailbox (#1418)
  • Loading branch information
mercihabam authored Jan 3, 2025
1 parent 32d2d9c commit 82e6489
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/imap/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1644,13 +1644,13 @@ function flattenMessagesLists($messagesLists, $listSize) {
$part = array_slice($list, 0, $listSize);
$endList = array_merge($endList, $part);
$messagesLists[$index] = array_slice($list, $listSize);
$sizesTaken[$index] = $sizesTaken[$index] ? $sizesTaken[$index] + count($part) : count($part);
$sizesTaken[$index] = isset($sizesTaken[$index]) ? $sizesTaken[$index] + count($part) : count($part);
$totalTakens = array_sum(array_values($sizesTaken));
if ($totalTakens > $max) {
$sizesTaken[$index] = $sizesTaken[$index] - ($totalTakens - $max);
}
} else {
$sizesTaken[$index] = $sizesTaken[$index] ? $sizesTaken[$index] : 0;
$sizesTaken[$index] = isset($sizesTaken[$index]) ? $sizesTaken[$index] : 0;
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions modules/imap/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,16 @@ var setup_imap_folder_page = async function(listPath, listPage = 1) {
select_imap_folder(listPath, listPage, true);
}
});
$('.imap_filter').on("change", function() { $('#imap_filter_form').trigger('submit'); });
$('.imap_sort').on("change", function() {
$('.imap_filter').on("change", function(e) {
e.preventDefault();
$('#imap_filter_form').trigger('submit');
});
$('.imap_keyword').on('search', function() {
$('.imap_sort').on("change", function(e) {
e.preventDefault();
$('#imap_filter_form').trigger('submit');
});
$('.imap_keyword').on('search', function(e) {
e.preventDefault();
$('#imap_filter_form').trigger('submit');
});

Expand Down

0 comments on commit 82e6489

Please sign in to comment.