mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Merge branch 'master' of github.com:the-djmaze/snappymail
This commit is contained in:
commit
36c8b97cb1
|
@ -301,9 +301,13 @@ populateMessageBody = (oMessage, popup) => {
|
||||||
} else {
|
} else {
|
||||||
let json = oData?.Result;
|
let json = oData?.Result;
|
||||||
if (json
|
if (json
|
||||||
&& oMessage.hash === json.hash
|
&& ((
|
||||||
// && oMessage.folder === json.folder
|
oMessage.hash && oMessage.hash === json.hash
|
||||||
// && oMessage.uid == json.uid
|
) || (
|
||||||
|
!oMessage.hash
|
||||||
|
&& oMessage.folder === json.folder
|
||||||
|
&& oMessage.uid == json.uid)
|
||||||
|
)
|
||||||
&& oMessage.revivePropertiesFromJson(json)
|
&& oMessage.revivePropertiesFromJson(json)
|
||||||
) {
|
) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -13,6 +13,7 @@ document.onreadystatechange = () => {
|
||||||
passThemesToIFrame();
|
passThemesToIFrame();
|
||||||
let form = document.querySelector('form.snappymail');
|
let form = document.querySelector('form.snappymail');
|
||||||
form && SnappyMailFormHelper(form);
|
form && SnappyMailFormHelper(form);
|
||||||
|
setupUnifiedSearchListener()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -136,15 +137,22 @@ function SnappyMailFormHelper(oForm)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
} catch (e) {
|
||||||
catch(e) {
|
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setupUnifiedSearchListener() {
|
||||||
|
const iframe = document.getElementById('rliframe');
|
||||||
|
if (!iframe || !iframe.contentWindow) return;
|
||||||
|
|
||||||
addEventListener('hashchange', (event) => {
|
addEventListener('hashchange', (event) => {
|
||||||
const search = event.newURL.substring(event.newURL.lastIndexOf('/') + 1);
|
const hashIndex = event.newURL.indexOf('#/mailbox/');
|
||||||
if (search && search.length < 25) {
|
if (hashIndex !== -1) {
|
||||||
document.getElementById('rliframe').contentWindow.rl.app.messageList.mainSearch(search);
|
const hash = event.newURL.substring(hashIndex + 1);
|
||||||
|
if (/\/[\w-]+\/[\w-]+\/\w\d+\/.{0,24}/.test(hash)) {
|
||||||
|
iframe.contentWindow.location.hash = hash;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue