Skip to content

Commit

Permalink
fix(frontend): cut off content polluting the prev & next links and ad…
Browse files Browse the repository at this point in the history
…dress the incompatibility between Cash and jQuery in the advanced search checkboxes generator (#1387)

* fix Cash library incompatibility with jQuery in the advanced search checkboxes generator script

* Cut off the body content included in the previous and next links
  • Loading branch information
mercihabam authored Nov 26, 2024
1 parent cf725c7 commit 11a3973
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
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

0 comments on commit 11a3973

Please sign in to comment.