Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): cut off content polluting the prev & next links and address the incompatibility between Cash and jQuery in the advanced search checkboxes generator #1387

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/advanced_search/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var adv_select_imap_folder = function(el) {
folders.show();

folders.find('li').each(function(index) {
const wrapper = $('<div class="d-flex justify-content-between"></div>');
const wrapper = $('<div class="d-flex justify-content-between wrapper"></div>');
$(this).wrapInner(wrapper);
const allSpecialFoldersCheckbox = `
<span class="form-check">
Expand All @@ -130,7 +130,7 @@ var adv_select_imap_folder = function(el) {
const checkboxesWrapper = $('<div class="d-flex gap-3"></div>');
checkboxesWrapper.append(allSpecialFoldersCheckbox);
checkboxesWrapper.append(allFoldersCheckbox);
wrapper.append(checkboxesWrapper);
$(this).find('.wrapper').append(checkboxesWrapper);
})

$('.imap_folder_link', folders).addClass('adv_folder_link').removeClass('imap_folder_link');
Expand Down
13 changes: 7 additions & 6 deletions modules/core/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,16 +849,17 @@ function Message_List() {
const next = messages.getNextRowForMessage(msgUid);
const prev = messages.getPreviousRowForMessage(msgUid);
if (prev) {
const prevSubject = $(prev['0']).find('.subject');
phref = prevSubject.find('a').prop('href');
const subject = new Option(prevSubject.text()).innerHTML;
const prevSubject = $(prev['0']).find('.subject a');
phref = prevSubject.prop('href');
const subject = prevSubject.text();
const plink = '<a class="plink" href="'+phref+'"><i class="prevnext bi bi-arrow-left-square-fill"></i> '+subject+'</a>';
$('<tr class="prev"><th colspan="2">'+plink+'</th></tr>').insertBefore(target);
}
if (next) {
const nextSubject = $(next['0']).find('.subject');
nhref = nextSubject.find('a').prop('href');
const subject = new Option(nextSubject.text()).innerHTML;
const nextSubject = $(next['0']).find('.subject a');
nhref = nextSubject.prop('href');
const subject = nextSubject.text();

const nlink = '<a class="nlink" href="'+nhref+'"><i class="prevnext bi bi-arrow-right-square-fill"></i> '+subject+'</a>';
$('<tr class="next"><th colspan="2">'+nlink+'</th></tr>').insertBefore(target);
}
Expand Down
Loading