From 57c9066f81399e194d2fc94c6c6a22f37321aeb7 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Fri, 26 Feb 2021 14:08:04 -0800 Subject: [PATCH 1/4] Closing should only navigate if closing current document --- src-ui/src/app/components/app-frame/app-frame.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/components/app-frame/app-frame.component.ts b/src-ui/src/app/components/app-frame/app-frame.component.ts index 05b1f3f68..18e30b0cd 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.ts +++ b/src-ui/src/app/components/app-frame/app-frame.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import { from, Observable, Subscription } from 'rxjs'; +import { from, Observable, Subscription, BehaviorSubject } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators'; import { PaperlessDocument } from 'src/app/data/paperless-document'; import { OpenDocumentsService } from 'src/app/services/open-documents.service'; @@ -86,7 +86,7 @@ export class AppFrameComponent implements OnInit { while (route.firstChild) { route = route.firstChild } - if (route.component == DocumentDetailComponent) { + if (route.component == DocumentDetailComponent && (route.params as BehaviorSubject).getValue()['id'] == d.id) { this.router.navigate([""]) } } From a26150ca405b412271be14e053e164f4fc228fed Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Fri, 26 Feb 2021 14:08:13 -0800 Subject: [PATCH 2/4] Hover state for close x button --- .../src/app/components/app-frame/app-frame.component.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src-ui/src/app/components/app-frame/app-frame.component.scss b/src-ui/src/app/components/app-frame/app-frame.component.scss index 7fa588e9e..6fa0f6164 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.scss +++ b/src-ui/src/app/components/app-frame/app-frame.component.scss @@ -79,6 +79,14 @@ right: .4rem; width: 1.8rem; height: 100%; + + svg { + opacity: 50%; + } + + &:hover svg { + opacity: 100%; + } } .nav-link-additional { From 6ad14d63d6fd651565d06b51527646aab415ba22 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Fri, 26 Feb 2021 14:11:25 -0800 Subject: [PATCH 3/4] Consistency please --- src-ui/src/app/components/app-frame/app-frame.component.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/components/app-frame/app-frame.component.scss b/src-ui/src/app/components/app-frame/app-frame.component.scss index 6fa0f6164..0ce91f779 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.scss +++ b/src-ui/src/app/components/app-frame/app-frame.component.scss @@ -81,11 +81,11 @@ height: 100%; svg { - opacity: 50%; + opacity: 0.5; } &:hover svg { - opacity: 100%; + opacity: 1; } } From 8a648987986213c45b5156bc4c7eabcbe9891102 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Fri, 26 Feb 2021 14:16:31 -0800 Subject: [PATCH 4/4] TypeScript fixes --- src-ui/src/app/components/app-frame/app-frame.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/components/app-frame/app-frame.component.ts b/src-ui/src/app/components/app-frame/app-frame.component.ts index 18e30b0cd..91177fc54 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.ts +++ b/src-ui/src/app/components/app-frame/app-frame.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, Params } from '@angular/router'; import { from, Observable, Subscription, BehaviorSubject } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators'; import { PaperlessDocument } from 'src/app/data/paperless-document'; @@ -86,7 +86,7 @@ export class AppFrameComponent implements OnInit { while (route.firstChild) { route = route.firstChild } - if (route.component == DocumentDetailComponent && (route.params as BehaviorSubject).getValue()['id'] == d.id) { + if (route.component == DocumentDetailComponent && (route.params as BehaviorSubject).getValue()['id'] == d.id) { this.router.navigate([""]) } }