fix mobile search, reorder menu

This commit is contained in:
_Bastler 2022-12-07 21:29:32 +01:00
parent 01d705f5fb
commit 4a4917e4ed
5 changed files with 22 additions and 20 deletions

View File

@ -2,7 +2,7 @@
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"appData": {
"version": "1.5.1"
"version": "1.5.2"
},
"assetGroups": [
{

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "bstlboard",
"version": "1.5.1",
"version": "1.5.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "bstlboard",
"version": "1.5.1",
"version": "1.5.2",
"license": "AGPL3",
"dependencies": {
"@angular-material-components/datetime-picker": "^9.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "bstlboard",
"version": "1.5.1",
"version": "1.5.2",
"license": "AGPL3",
"scripts": {
"ng": "ng",

View File

@ -45,10 +45,10 @@
</mat-toolbar>
<mat-sidenav-container>
<mat-sidenav #sidenav [mode]="isBiggerScreen() ? 'side' : 'over'" [(opened)]="opened"
<mat-sidenav #sidenav [mode]="isBiggerScreen() ? 'side' : 'over'" [(opened)]="opened || searchFocus"
(click)="!isBiggerScreen() && this.close()">
<mat-nav-list>
<ui-viewmenu *ngIf="authenticated"></ui-viewmenu>
<mat-nav-list *ngIf="authenticated">
<ui-viewmenu></ui-viewmenu>
<mat-divider *ngIf="moderator"></mat-divider>
<a *ngIf="moderator" routerLink="/moderation/entries" routerLinkActive="active" mat-list-item>
<mat-icon matListItemIcon>report</mat-icon>
@ -58,12 +58,18 @@
<mat-icon matListItemIcon>feedback</mat-icon>
<span>{{'moderation.comments' | i18n}}</span>
</a>
<mat-divider *ngIf="authenticated"></mat-divider>
<a *ngIf="authenticated" routerLink="/bookmarks" routerLinkActive="active" mat-list-item>
<mat-divider></mat-divider>
<a routerLink="/bookmarks" routerLinkActive="active" mat-list-item>
<mat-icon matListItemIcon>bookmarks</mat-icon>
<span>{{'bookmarks' | i18n}}</span>
</a>
<mat-divider *ngIf="authenticated"></mat-divider>
</mat-nav-list>
<mat-form-field *ngIf="authenticated" (click)="preventClose($event)">
<input matInput type="text" (change)="search($event.target && $event.target.value || undefined, $event)"
placeholder="{{'search' | i18n}}" (focus)="searchFocus = true" (blur)="searchFocus = false">
</mat-form-field>
<span class="spacer"></span>
<mat-nav-list>
<a (click)="openExternal($event,'https://wiki.bstly.de/services/bstlboard#faq','_blank')"
routerLinkActive="active" mat-list-item>
<mat-icon matListItemIcon>help</mat-icon>
@ -71,12 +77,6 @@
</a>
</mat-nav-list>
<mat-form-field *ngIf="authenticated" (click)="preventClose($event)">
<input matInput type="text" (change)="search($event.target && $event.target.value || undefined, $event)"
placeholder="{{'search' | i18n}}">
</mat-form-field>
<span class="spacer"></span>
<mat-nav-list>
<mat-divider></mat-divider>
<a (click)="openExternal($event,'https://www.bstly.de/imprint/')" mat-list-item style="font-size: 0.7em;">

View File

@ -27,11 +27,12 @@ export class UiMain {
locales;
authenticated: boolean = false;
moderator: boolean = false;
searchFocus: boolean = false;
touchThresh: number = 150;
touchStartX: number;
touchX: number;
version = packageJson.version;
constructor(
@ -105,13 +106,14 @@ export class UiMain {
}
search(text, event) {
if (text) {
this.router.navigate(["search"], { queryParams: { q: text } });
}
event.target.value = '';
event.target.blur();
if (!this.isBiggerScreen()) {
this.close();
}
if (text) {
this.router.navigate(["search"], { queryParams: { q: text } });
}
}
toggleDarkTheme() {