- Fixed theme css path
- Fixed slider thumbs initializing in the wrong position
This commit is contained in:
Geomitron
2021-04-06 18:40:00 -05:00
parent 0b427d0cee
commit 1c860bd0d9
5 changed files with 24 additions and 14 deletions

View File

@@ -1,5 +1,8 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "1.3.0",
"version": "1.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "1.3.0",
"version": "1.3.1",
"description": "A Clone Hero library management tool with built in chart searching and downloading.",
"homepage": "https://github.com/Geomitron/Bridge",
"license": "GPL-3.0",

View File

@@ -17,6 +17,7 @@ export class SearchBarComponent implements AfterViewInit {
isError = false
showAdvanced = false
searchSettings = getDefaultSearch()
private sliderInitialized = false
constructor(public searchService: SearchService) { }
@@ -37,17 +38,6 @@ export class SearchBarComponent implements AfterViewInit {
this.searchSettings.similarity = value as 'similar' | 'exact'
}
})
$(this.diffSlider.nativeElement).slider({
min: 0,
max: 6,
start: 0,
end: 6,
step: 1,
onChange: (_length: number, min: number, max: number) => {
this.searchSettings.minDiff = min
this.searchSettings.maxDiff = max
}
})
}
onSearch(query: string) {
@@ -59,6 +49,23 @@ export class SearchBarComponent implements AfterViewInit {
onAdvancedSearchClick() {
this.showAdvanced = !this.showAdvanced
if (!this.sliderInitialized) {
setTimeout(() => { // Initialization requires this element to not be collapsed
$(this.diffSlider.nativeElement).slider({
min: 0,
max: 6,
start: 0,
end: 6,
step: 1,
onChange: (_length: number, min: number, max: number) => {
this.searchSettings.minDiff = min
this.searchSettings.maxDiff = max
}
})
}, 50)
this.sliderInitialized = true
}
}
isLoading() {

View File

@@ -39,7 +39,7 @@ export class SettingsService {
const link = document.createElement('link')
link.type = 'text/css'
link.rel = 'stylesheet'
link.href = `./assets/themes/${theme}.css`
link.href = `./assets/themes/${theme.toLowerCase()}.css`
this.currentThemeLink = document.head.appendChild(link)
}