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", "$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html", "index": "/index.html",
"appData": { "appData": {
"version": "1.5.1" "version": "1.5.2"
}, },
"assetGroups": [ "assetGroups": [
{ {

4
package-lock.json generated
View File

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

View File

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

View File

@ -45,10 +45,10 @@
</mat-toolbar> </mat-toolbar>
<mat-sidenav-container> <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()"> (click)="!isBiggerScreen() && this.close()">
<mat-nav-list> <mat-nav-list *ngIf="authenticated">
<ui-viewmenu *ngIf="authenticated"></ui-viewmenu> <ui-viewmenu></ui-viewmenu>
<mat-divider *ngIf="moderator"></mat-divider> <mat-divider *ngIf="moderator"></mat-divider>
<a *ngIf="moderator" routerLink="/moderation/entries" routerLinkActive="active" mat-list-item> <a *ngIf="moderator" routerLink="/moderation/entries" routerLinkActive="active" mat-list-item>
<mat-icon matListItemIcon>report</mat-icon> <mat-icon matListItemIcon>report</mat-icon>
@ -58,12 +58,18 @@
<mat-icon matListItemIcon>feedback</mat-icon> <mat-icon matListItemIcon>feedback</mat-icon>
<span>{{'moderation.comments' | i18n}}</span> <span>{{'moderation.comments' | i18n}}</span>
</a> </a>
<mat-divider *ngIf="authenticated"></mat-divider> <mat-divider></mat-divider>
<a *ngIf="authenticated" routerLink="/bookmarks" routerLinkActive="active" mat-list-item> <a routerLink="/bookmarks" routerLinkActive="active" mat-list-item>
<mat-icon matListItemIcon>bookmarks</mat-icon> <mat-icon matListItemIcon>bookmarks</mat-icon>
<span>{{'bookmarks' | i18n}}</span> <span>{{'bookmarks' | i18n}}</span>
</a> </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')" <a (click)="openExternal($event,'https://wiki.bstly.de/services/bstlboard#faq','_blank')"
routerLinkActive="active" mat-list-item> routerLinkActive="active" mat-list-item>
<mat-icon matListItemIcon>help</mat-icon> <mat-icon matListItemIcon>help</mat-icon>
@ -71,12 +77,6 @@
</a> </a>
</mat-nav-list> </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-nav-list>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<a (click)="openExternal($event,'https://www.bstly.de/imprint/')" mat-list-item style="font-size: 0.7em;"> <a (click)="openExternal($event,'https://www.bstly.de/imprint/')" mat-list-item style="font-size: 0.7em;">

View File

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