update dependencies, improve views

This commit is contained in:
2022-12-07 18:25:03 +01:00
parent b602564781
commit 94b8792de8
25 changed files with 6563 additions and 5548 deletions
+14 -7
View File
@@ -13,7 +13,7 @@ import { SettingsService } from '../../services/settings.service';
@Component({
selector: 'ui-main',
templateUrl: './main.ui.html',
styleUrls: [ './main.ui.scss' ]
styleUrls: ['./main.ui.scss']
})
export class UiMain {
@@ -91,6 +91,13 @@ export class UiMain {
}
}
search(text, event) {
if (text) {
this.router.navigate(["search"], { queryParams: { q: text } });
}
event.target.value = '';
}
toggleDarkTheme() {
this.darkTheme = !this.darkTheme;
@@ -112,7 +119,7 @@ export class UiMain {
logout() {
localStorage.removeItem("bstlboard.autologin");
this.authService.logout().subscribe(data => {
this.router.navigate([ "" ]).then(() => {
this.router.navigate([""]).then(() => {
window.location.reload();
});
})
@@ -131,7 +138,7 @@ export class UiMain {
window.open(url, target);
}
@HostListener('window:resize', [ '$event' ])
@HostListener('window:resize', ['$event'])
onResize(event) {
if (event.target.innerWidth < 768) {
this.opened = false;
@@ -142,14 +149,14 @@ export class UiMain {
touchEvents(): void {
fromEvent(document, 'touchstart').subscribe((event: TouchEvent) => {
if (event.touches[ 0 ]) {
this.touchStartX = event.touches[ 0 ].screenX;
if (event.touches[0]) {
this.touchStartX = event.touches[0].screenX;
}
})
fromEvent(document, 'touchmove').subscribe((event: TouchEvent) => {
if (event.touches[ 0 ]) {
this.touchX = event.touches[ 0 ].screenX;
if (event.touches[0]) {
this.touchX = event.touches[0].screenX;
}
})