MCPcopy Index your code
hub / github.com/MALSync/MALSync / openMinimal

Function openMinimal

src/floatbutton/extension.ts:13–27  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

11}
12
13export function openMinimal(callback) {
14 const width = getPixel(api.settings.get('miniMalWidth'), window.screen.width);
15 const height = getPixel(api.settings.get('miniMalHeight'), window.screen.height);
16
17 let left;
18 if (api.settings.get('posLeft') === 'right') {
19 left = window.screen.width - width;
20 } else if (api.settings.get('posLeft') === 'left') {
21 left = 1;
22 } else {
23 left = 0;
24 }
25
26 chrome.runtime.sendMessage({ name: 'minimalWindow', height, width, left }, callback);
27}
28
29function getPixel(val: string, screenSize: number): number {
30 if (/^\d+px$/i.test(val)) {

Callers 2

popup.tsFile · 0.90
floatClickFunction · 0.85

Calls 3

getPixelFunction · 0.85
sendMessageMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected