mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Added isDraggable
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user