fix(router): open in a new tab
This commit is contained in:
parent
8788a43b35
commit
95ebeca4ab
1 changed files with 5 additions and 4 deletions
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue