Skip to content

Commit

Permalink
fix: positioning of quick class switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
KraXen72 committed May 25, 2023
1 parent 9ce1360 commit c13638f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const strippedConsole = {
timeEnd: console.timeEnd.bind(console)
};

export const classPickerBottom = '80px'
const $assets = pathResolve(__dirname, '..', 'assets');
const repoID = 'KraXen72/crankshaft';
let lastActiveTab = 0;
Expand Down Expand Up @@ -159,7 +160,7 @@ ipcRenderer.on('injectClientCSS', (event, { hideAds, menuTimer, quickClassPicker
// TODO rewrite, this is not well scalable
if (hideAds) {
toggleSettingCSS(styleSettingsCSS.hideAds, 'hideAds', true);
document.getElementById("hiddenClasses").style.bottom = '40px';
document.getElementById("hiddenClasses").style.bottom = classPickerBottom;
}
if (menuTimer) toggleSettingCSS(styleSettingsCSS.menuTimer, 'menuTimer', true);
if (quickClassPicker) toggleSettingCSS(styleSettingsCSS.quickClassPicker, 'quickClassPicker', true)
Expand Down
5 changes: 2 additions & 3 deletions src/settingsui.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

/* eslint-disable max-len */
import { writeFileSync } from 'fs';
import { ipcRenderer } from 'electron'; // add app if crashes
import { createElement, toggleSettingCSS } from './utils';
import { styleSettingsCSS } from './preload';
import { styleSettingsCSS, classPickerBottom } from './preload';
import { su } from './userscripts';

/// <reference path="global.d.ts" />
Expand Down Expand Up @@ -246,7 +245,7 @@ class SettingElem {
// you can add custom instant refresh callbacks for settings here
if (this.props.key === 'hideAds') {
toggleSettingCSS(styleSettingsCSS.hideAds, this.props.key, value);
document.getElementById("hiddenClasses").style.bottom = value ? '40px' : null;
document.getElementById("hiddenClasses").style.bottom = value ? classPickerBottom : null;
}
if (this.props.key === 'menuTimer') toggleSettingCSS(styleSettingsCSS.menuTimer, this.props.key, value);
if (this.props.key === 'quickClassPicker') toggleSettingCSS(styleSettingsCSS.quickClassPicker, this.props.key, value);
Expand Down

0 comments on commit c13638f

Please sign in to comment.