Skip to content

Commit

Permalink
js: prevent link button from multiplying
Browse files Browse the repository at this point in the history
  • Loading branch information
paveyry committed Mar 22, 2021
1 parent 6ed0193 commit 302195b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ function inject(){
};

var addLinkButton = function(searchButton) {
var existing = document.getElementById("displayLinkButton");
if (existing != null && existing.length > 0) {
return;
}
button = document.createElement("div");
button.innerHTML = '<div id="displayLinkButton"><div class="U26fgb mUbCce fKz7Od" title="Show thread links"><span class="xjKiLb"><span style="top: -12px"><svg viewBox="0 0 16 16" class="GfYBMd Kol3Vd V3Pk2"> <path d="M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9c-.086 0-.17.01-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"></path><path d="M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4.02 4.02 0 0 1-.82 1H12a3 3 0 1 0 0-6H9z"></path></svg></span></span></div></div>';
searchButton.parentElement.insertBefore(button.childNodes[0], searchButton);
Expand Down

0 comments on commit 302195b

Please sign in to comment.