fix(router): open in a new tab

This commit is contained in:
Rushabh Mehta 2020-12-18 11:40:50 +05:30
parent 8788a43b35
commit 95ebeca4ab

View file

@ -39,14 +39,15 @@ $('body').on('click', 'a', function(e) {
return false;
};
const href = e.currentTarget.getAttribute('href');
// click handled, but not by href
if (e.currentTarget.getAttribute('onclick')) {
if (e.currentTarget.getAttribute('onclick') // has a handler
|| (e.ctrlKey || e.metaKey) // open in a new tab
|| href==='#') { // hash is home
return;
}
const href = e.currentTarget.getAttribute('href');
if (href==='#') return;
if (href==='') {
return override('/app');
}