فهرست منبع

fix: support for mac modifier keys

Sven 10 ماه پیش
والد
کامیت
caef07f863
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 4 4
      src/features/layout.ts
  2. 1 1
      src/features/lyrics.ts

+ 4 - 4
src/features/layout.ts

@@ -2,11 +2,11 @@ import { addParent, autoPlural, debounce, fetchAdvanced, pauseFor } from "@sv443
 import { getFeature, getFeatures } from "../config.js";
 import { siteEvents } from "../siteEvents.js";
 import { addSelectorListener } from "../observers.js";
-import { error, getResourceUrl, log, warn, t, onInteraction, openInTab, getBestThumbnailUrl, getDomain, addStyle, currentMediaType, domLoaded, waitVideoElementReady, getVideoTime, fetchCss, addStyleFromResource, fetchVideoVotes, getWatchId, type VideoVotesObj, getLocale, tp } from "../utils/index.js";
+import { error, getResourceUrl, log, warn, t, onInteraction, openInTab, getBestThumbnailUrl, getDomain, addStyle, currentMediaType, domLoaded, waitVideoElementReady, getVideoTime, fetchCss, addStyleFromResource, fetchVideoVotes, getWatchId, getLocale, tp } from "../utils/index.js";
 import { mode, scriptInfo } from "../constants.js";
 import { openCfgMenu } from "../menu/menu_old.js";
 import { createCircularBtn, createRipple } from "../components/index.js";
-import type { ResourceKey } from "../types.js";
+import type { ResourceKey, VideoVotesObj } from "../types.js";
 import "./layout.css";
 
 //#region cfg menu btns
@@ -381,7 +381,7 @@ export async function initAboveQueueBtns() {
 
         activeItem.scrollIntoView({
           behavior: evt.shiftKey ? "instant" : "smooth",
-          block: evt.ctrlKey ? "end" : "center",
+          block: evt.ctrlKey || evt.altKey ? "end" : "center",
           inline: "center",
         });
       },
@@ -713,7 +713,7 @@ export async function fixHdrIssues() {
     log("Fixed HDR issues");
 }
 
-//#region show dis-/likes
+//#region show vote nums
 
 /** Shows the amount of likes and dislikes on the current song */
 export async function initShowVotes() {

+ 1 - 1
src/features/lyrics.ts

@@ -407,7 +407,7 @@ export async function createLyricsBtn(geniusUrl?: string, hideIfLoading = true)
   linkElem.appendChild(imgElem);
 
   onInteraction(linkElem, async (e) => {
-    if(e.ctrlKey) {
+    if(e.ctrlKey || e.altKey) {
       e.preventDefault();
       e.stopPropagation();