Remove submitting on mobile

This commit is contained in:
Ajay Ramachandran
2020-07-05 00:07:10 -04:00
parent 59c5b7eefe
commit 0b9df8a45c

View File

@@ -1026,18 +1026,10 @@ function createButton(baseID, title, callback, imageName, isDraggable=false): bo
newButton.draggable = isDraggable;
newButton.id = baseID + "Button";
newButton.classList.add("playerButton");
if (!onMobileYouTube) {
newButton.classList.add("ytp-button");
} else {
newButton.classList.add("icon-button");
newButton.style.padding = "0";
}
newButton.classList.add("ytp-button");
newButton.setAttribute("title", chrome.i18n.getMessage(title));
newButton.addEventListener("click", (event: Event) => {
callback();
// Prevents the contols from closing when clicked
if (onMobileYouTube) event.stopPropagation();
});
// Image HTML
@@ -1079,6 +1071,8 @@ function getControls(): HTMLElement | boolean {
//adds all the player controls buttons
async function createButtons(): Promise<boolean> {
if (onMobileYouTube) return;
let result = await utils.wait(getControls).catch();
//set global controls variable