From 995e73a1b5ad422d1229d5bbf5f811b2f1d0729f Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 1 Jul 2022 15:44:05 +0300 Subject: [PATCH] Fix dropdown-filter bug with hide() --- .../dropdown-filter.component.ts | 19 ++++++++++-------- utils/icons/icons.ts | 20 +++---------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/utils/dropdown-filter/dropdown-filter.component.ts b/utils/dropdown-filter/dropdown-filter.component.ts index dc18d62c..5a276133 100644 --- a/utils/dropdown-filter/dropdown-filter.component.ts +++ b/utils/dropdown-filter/dropdown-filter.component.ts @@ -1,15 +1,16 @@ -import {Component, Input, ViewChild} from "@angular/core"; +import {Component, ElementRef, Input, ViewChild} from "@angular/core"; declare var UIkit; @Component({ selector: 'dropdown-filter', template: ` - -
+
` @@ -21,13 +22,15 @@ export class DropdownFilterComponent { public count: number = 0; @Input() public dropdownClass: string; - @ViewChild("dropdown") dropdown; + @Input() + public disabled = false; + @ViewChild("dropdownElement") dropdownElement: ElementRef; - isOpen(element) { - return UIkit.dropdown(element).isActive(); + get isOpen() { + return this.dropdownElement && UIkit.dropdown(this.dropdownElement.nativeElement).isActive(); } closeDropdown() { - UIkit.dropdown(this.dropdown).hide(); + UIkit.dropdown(this.dropdownElement.nativeElement).hide(); } } diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts index a62fe561..cf839749 100644 --- a/utils/icons/icons.ts +++ b/utils/icons/icons.ts @@ -210,26 +210,12 @@ export const orcid_bin = { export const link = { name: 'link', - data: '\n' + - ' ' + data: '' } /** Add new icon under this line to be sure that it will be added on preview */ export const quotes = { name: 'quotes', - data: '\n' + - ' \n' + - ' \n' + - ' ' -} \ No newline at end of file + data: '' +}