From d5999ad330efd54cf092af9049294d03141a1cd2 Mon Sep 17 00:00:00 2001 From: Official Noob <31563761+OfficialNoob@users.noreply.github.com> Date: Thu, 22 Aug 2019 19:39:17 +0100 Subject: [PATCH] Added isDraggable --- content.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);