From e5621ad1ab86d6b2d27156bf45d5e05dd9e6d655 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 10 Jul 2019 19:22:32 +0200 Subject: [PATCH] Prevent motion-detail jumps - Fixes an error where the extension label could open automatically due to state changes by others. - Changes the quick-navigation div to a host-listener - Changes the quick-navigation keys to meta+alt+arrow to shift+alt+arrow, since Firefox does not recognize meta - Removed the ID from all os-sort-lists and moves it into the extra controls of category-motion-sort-list --- .../extension-field.component.ts | 37 ++----------------- .../sorting-list/sorting-list.component.html | 3 -- .../category-motions-sort.component.html | 21 +++++------ .../motion-detail.component.html | 1 - .../motion-detail/motion-detail.component.ts | 8 ++-- 5 files changed, 17 insertions(+), 53 deletions(-) diff --git a/client/src/app/shared/components/extension-field/extension-field.component.ts b/client/src/app/shared/components/extension-field/extension-field.component.ts index 1786f2721..3cb2ac973 100644 --- a/client/src/app/shared/components/extension-field/extension-field.component.ts +++ b/client/src/app/shared/components/extension-field/extension-field.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input, Output, EventEmitter, OnDestroy, AfterViewInit } from '@angular/core'; +import { Component, OnInit, Input, Output, EventEmitter, OnDestroy } from '@angular/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { FormGroup, FormBuilder } from '@angular/forms'; import { Router, NavigationEnd } from '@angular/router'; @@ -8,7 +8,7 @@ import { Router, NavigationEnd } from '@angular/router'; templateUrl: './extension-field.component.html', styleUrls: ['./extension-field.component.scss'] }) -export class ExtensionFieldComponent implements OnInit, OnDestroy, AfterViewInit { +export class ExtensionFieldComponent implements OnInit, OnDestroy { /** * Optional additional classes for the `mat-chip`. */ @@ -27,33 +27,11 @@ export class ExtensionFieldComponent implements OnInit, OnDestroy, AfterViewInit @Input() public chipValue: string; - /** - * Allow automatically jump into autoEdit - */ - private allowAutoEdit = false; - /** * Boolean, whether the extension should be shown. */ - private _hasExtension = false; - - /** - * Setter for the extension condition - */ - @Input() public set hasExtension(extension: boolean) { - this._hasExtension = extension; - - if (this.hasExtension && this.allowAutoEdit) { - this.editMode = true; - } - } - - /** - * Getter for the extension condition - */ - public get hasExtension(): boolean { - return this._hasExtension; - } + @Input() + public hasExtension = false; /** * Optional label for the input. @@ -193,13 +171,6 @@ export class ExtensionFieldComponent implements OnInit, OnDestroy, AfterViewInit } } - /** - * After view inits, allow to automatically open the edit view - */ - public ngAfterViewInit(): void { - this.allowAutoEdit = true; - } - /** * On destroy unsubscribe from the subscriptions */ diff --git a/client/src/app/shared/components/sorting-list/sorting-list.component.html b/client/src/app/shared/components/sorting-list/sorting-list.component.html index 1bed0380a..d041e8978 100644 --- a/client/src/app/shared/components/sorting-list/sorting-list.component.html +++ b/client/src/app/shared/components/sorting-list/sorting-list.component.html @@ -19,9 +19,6 @@
- - {{ item.id }} -
diff --git a/client/src/app/site/motions/modules/category/components/category-motions-sort/category-motions-sort.component.html b/client/src/app/site/motions/modules/category/components/category-motions-sort/category-motions-sort.component.html index 67a420bcf..79aa99ada 100644 --- a/client/src/app/site/motions/modules/category/components/category-motions-sort/category-motions-sort.component.html +++ b/client/src/app/site/motions/modules/category/components/category-motions-sort/category-motions-sort.component.html @@ -1,8 +1,4 @@ - +

{{ 'Sort motions' | translate }} ({{ category.prefixedName }})

@@ -13,12 +9,13 @@
{{ sortSelector.multiSelectedIndex.length }}  selected - +
- + + + + {{ motion.id }} + + + diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html index fcac8bf9f..52f9f2bfd 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html @@ -1,4 +1,3 @@ -