aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOfficial Noob <[email protected]>2019-08-22 19:39:17 +0100
committerGitHub <[email protected]>2019-08-22 19:39:17 +0100
commitd5999ad330efd54cf092af9049294d03141a1cd2 (patch)
tree0911357a3dae1a502c15d9b6aab045bb0c6028c5
parent146ece3bff098ed47b2e23f4f949597b6bf19de1 (diff)
downloadSponsorBlock-d5999ad330efd54cf092af9049294d03141a1cd2.tar.gz
SponsorBlock-d5999ad330efd54cf092af9049294d03141a1cd2.zip
Added isDraggable
-rw-r--r--content.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/content.js b/content.js
index bcbeb591..f668f9e0 100644
--- a/content.js
+++ b/content.js
@@ -538,16 +538,18 @@ function removePlayerControlsButton() {
document.getElementById("submitButton").style.display = "none";
}
-function createButton(baseID, title, callback, imageName) {
+function createButton(baseID, title, callback, imageName, isDraggable=false) {
if (document.getElementById(baseID+"Button") != null) return;
// Button HTML
let newButton = document.createElement("button");
+ newButton.draggable = isDraggable;
newButton.id = baseID+"Button";
newButton.className = "ytp-button playerButton";
newButton.setAttribute("title", chrome.i18n.getMessage(title));
newButton.addEventListener("click", callback);
// Image HTML
let newButtonImage = document.createElement("img");
+ newButton.draggable = isDraggable;
newButtonImage.id = baseID+"Image";
newButtonImage.className = "playerButtonImage";
newButtonImage.src = chrome.extension.getURL("icons/"+imageName);