From 256bcdcaedc780a947f00e4a9b36d7a292bb9523 Mon Sep 17 00:00:00 2001 From: narcolepticinsomniac Date: Fri, 24 Aug 2018 19:36:26 -0400 Subject: [PATCH] Fix direct link click action and simplify conditional href --- popup/popup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/popup/popup.js b/popup/popup.js index 8d060e64..8abd456a 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -379,7 +379,8 @@ Object.assign(handleEvent, { if (prefs.get('popupclick') === 1) { this.checkbox.dispatchEvent(new MouseEvent('click')); } else { - $('.style-edit-link').click(); + const entry = handleEvent.getClickedStyleElement(event); + $('.style-edit-link', entry).click(); } event.preventDefault(); }, @@ -489,7 +490,7 @@ Object.assign(handleEvent, { event.preventDefault(); getActiveTab() .then(activeTab => API.openURL({ - url: this.hasAttribute('href') && this.hasAttribute('data-href') === true ? this.dataset.href : this.href || this.dataset.href, + url: this.hasAttribute('data-href') ? this.dataset.href : this.href, index: activeTab.index + 1, message: tryJSONparse(this.dataset.sendMessage), }))