Fix button ordering

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/15/head
trivernis 3 years ago
parent b2500f362f
commit af5c5a59dc
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,5 +1,5 @@
<div class="sidebar-inner">
<mat-tab-group headerPosition="below">
<mat-tab-group (selectedTabChange)="this.onTabChange()" headerPosition="below">
<mat-tab label="Search">
<app-file-search (searchEndEvent)="this.onDisplayedFilesChange(); this.searchEndEvent.emit($event);"
(searchStartEvent)="this.searchStartEvent.emit($event)"

@ -1,4 +1,14 @@
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild} from "@angular/core";
import {
ChangeDetectorRef,
Component,
EventEmitter,
Input,
OnChanges,
OnInit,
Output,
SimpleChanges,
ViewChild
} from "@angular/core";
import {Tag} from "../../../../../api/models/Tag";
import {TagService} from "../../../../services/tag/tag.service";
import {File} from "../../../../../api/models/File";
@ -29,7 +39,11 @@ export class FilesTabSidebarComponent implements OnInit, OnChanges {
public tagsOfSelection: Tag[] = [];
public tagsLoading = false;
constructor(private repoService: RepositoryService, private tagService: TagService) {
constructor(
private changeDetector: ChangeDetectorRef,
private repoService: RepositoryService,
private tagService: TagService
) {
this.repoService.selectedRepository.subscribe(
async (repo) => repo && this.fileSearch && await this.fileSearch.searchForFiles());
this.tagService.tags.subscribe(t => this.allTags = t);
@ -79,6 +93,10 @@ export class FilesTabSidebarComponent implements OnInit, OnChanges {
this.tagsLoading = false;
}
public onTabChange(): void {
this.changeDetector.markForCheck();
}
private async refreshFileSelection() {
const filteredSelection = this.selectedFiles.filter(
file => this.files.findIndex(f => f.id === file.id) >= 0);

@ -19,8 +19,8 @@
class="filter-input"></app-filter-input>
</div>
<div class="dialog-actions" mat-dialog-actions>
<button (click)="confirmFilter()" color="primary" mat-flat-button>Filter</button>
<button (click)="cancelFilter()" color="accent" mat-stroked-button>Cancel</button>
<button (click)="confirmFilter()" color="primary" mat-flat-button>Filter</button>
</div>
<app-context-menu #contextMenu>
<button (click)="this.removeSelectedFilters()" mat-menu-item>Remove</button>

Loading…
Cancel
Save