feat(settings): added keymap legends style

This commit is contained in:
seaerchin 2021-04-08 00:06:43 +08:00
parent 60081674c4
commit 755d4489e3

View file

@ -13,6 +13,7 @@ import * as TagController from "./tag-controller";
import * as SimplePopups from "./simple-popups";
import * as EditTagsPopup from "./edit-tags-popup";
import * as ThemePicker from "./theme-picker";
import { KEYMAP_LEGEND_TITLE } from "../../static/keymap/legend";
export let groups = {};
async function initGroups() {
@ -51,9 +52,11 @@ async function initGroups() {
if (Config.keymapMode === "off") {
$(".pageSettings .section.keymapStyle").addClass("hidden");
$(".pageSettings .section.keymapLayout").addClass("hidden");
$(".pageSettings .section.keymapLegendStyle").addClass("hidden");
} else {
$(".pageSettings .section.keymapStyle").removeClass("hidden");
$(".pageSettings .section.keymapLayout").removeClass("hidden");
$(".pageSettings .section.keymapLegendStyle").removeClass("hidden");
}
}
);
@ -65,6 +68,10 @@ async function initGroups() {
"keymapLayout",
UpdateConfig.setKeymapLayout
);
groups.keymapLegendStyle = new SettingsGroup(
KEYMAP_LEGEND_TITLE,
UpdateConfig.setKeymapLegendStyle
);
groups.showKeyTips = new SettingsGroup(
"showKeyTips",
UpdateConfig.setKeyTips,
@ -578,7 +585,9 @@ $(
".pageSettings .section.discordIntegration .buttons .generateCodeButton"
).click((e) => {
Loader.show();
CloudFunctions.generatePairingCode({ uid: firebase.auth().currentUser.uid })
CloudFunctions.generatePairingCode({
uid: firebase.auth().currentUser.uid,
})
.then((ret) => {
Loader.hide();
if (ret.data.status === 1 || ret.data.status === 2) {
@ -715,7 +724,9 @@ $(".pageSettings .sectionGroupTitle").click((e) => {
{
duration: 250,
step: function (now) {
$(this).css({ transform: "rotate(" + now + "deg)" });
$(this).css({
transform: "rotate(" + now + "deg)",
});
},
}
);
@ -729,7 +740,9 @@ $(".pageSettings .sectionGroupTitle").click((e) => {
{
duration: 250,
step: function (now) {
$(this).css({ transform: "rotate(" + now + "deg)" });
$(this).css({
transform: "rotate(" + now + "deg)",
});
},
}
);