Commit ef99b5e8 authored by Kushal Pandya's avatar Kushal Pandya

Use plain JS within `clickTab`, make comment more concise

parent f9c23de6
...@@ -102,12 +102,18 @@ require('./flash'); ...@@ -102,12 +102,18 @@ require('./flash');
} }
clickTab(e) { clickTab(e) {
const targetLink = $(e.target).attr('href'); if (e.target) {
const targetLink = e.target.getAttribute('href');
// Allow following special clicks to make link open in new tab
// 1) Cmd + Click on Mac (e.metaKey)
// 2) Ctrl + Click on PC (e.ctrlKey)
// 3) Middle-click or Mouse Wheel Click (e.which is 2)
if (e.metaKey || e.ctrlKey || e.which === 2) { if (e.metaKey || e.ctrlKey || e.which === 2) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
window.open(targetLink, '_blank'); window.open(targetLink, '_blank');
} }
} }
}
tabShown(e) { tabShown(e) {
const $target = $(e.target); const $target = $(e.target);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment