mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-10 07:36:09 +08:00
parent
60b04c1f0c
commit
bcde1d6a8d
2 changed files with 9 additions and 3 deletions
|
@ -2,7 +2,6 @@ import * as DB from "./db";
|
|||
import * as Sound from "./controllers/sound-controller";
|
||||
import * as OutOfFocus from "./test/out-of-focus";
|
||||
import * as Notifications from "./elements/notifications";
|
||||
import * as BackgroundFilter from "./elements/custom-background-filter";
|
||||
import LayoutList from "./test/layouts";
|
||||
|
||||
export let localStorageConfig = null;
|
||||
|
@ -1240,8 +1239,6 @@ export function setCustomBackgroundSize(value, nosave) {
|
|||
|
||||
export function setCustomBackgroundFilter(array, nosave) {
|
||||
config.customBackgroundFilter = array;
|
||||
BackgroundFilter.loadConfig(config.customBackgroundFilter);
|
||||
BackgroundFilter.apply();
|
||||
if (!nosave) saveToLocalStorage();
|
||||
dispatchEvent("customBackgroundFilter", config.customBackgroundFilter);
|
||||
}
|
||||
|
|
|
@ -122,3 +122,12 @@ $(".section.customBackgroundFilter .save.button").click((e) => {
|
|||
UpdateConfig.setCustomBackgroundFilter(arr, false);
|
||||
Notifications.add("Custom background filters saved", 1);
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
UpdateConfig.subscribeToEvent((eventKey, eventValue) => {
|
||||
if (eventKey === "customBackgroundFilter") {
|
||||
loadConfig(eventValue);
|
||||
apply();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue