From 0c3c3b408b92ab3823f0044fc443322051e38be1 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 21 Jun 2022 14:39:27 +0300 Subject: [PATCH] Fix bug with dropdown after dragging event ends --- src/app/topic/indicators.component.html | 8 ++++---- src/app/topic/indicators.component.ts | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/app/topic/indicators.component.html b/src/app/topic/indicators.component.html index 9a99a44..d64f3e2 100644 --- a/src/app/topic/indicators.component.html +++ b/src/app/topic/indicators.component.html @@ -36,9 +36,9 @@
-
- + @@ -137,9 +137,9 @@
-
- + diff --git a/src/app/topic/indicators.component.ts b/src/app/topic/indicators.component.ts index 0677457..04ca1d4 100644 --- a/src/app/topic/indicators.component.ts +++ b/src/app/topic/indicators.component.ts @@ -75,13 +75,13 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV public indicator: Indicator; public index: number = -1; public editing: boolean = false; + public dragging: boolean = false; /** Caches */ public safeUrls: Map = new Map([]); public numberResponses: Map = new Map(); public numberResults: Map = new Map(); /** Import / Export Indicators */ importLoading: boolean = false; - exportLoading: boolean = false; @ViewChild('editChartModal', {static: true}) editChartModal: AlertModal; @ViewChild('editNumberModal', {static: true}) editNumberModal: AlertModal; @ViewChild('deleteModal', {static: true}) deleteModal: AlertModal; @@ -182,6 +182,12 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV this.reorderIndicators(list.current.id.toString().split('-')[1], type, reorder); }; this.numbers.forEach((section) => { + this.subscriptions.push(UIkit.util.on(document, 'start', '#number-' + section._id, (): void => { + this.dragging = true; + })); + this.subscriptions.push(UIkit.util.on(document, 'stop', '#number-' + section._id, (): void => { + this.dragging = false; + })); this.subscriptions.push(UIkit.util.on(document, 'moved', '#number-' + section._id, (list): void => { callback(list, "number", 'moved'); })); @@ -1281,7 +1287,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV public exportIndicators() { this.editing = true; - this.exportLoading = true; let indicators = []; let index: number = 0; this.numbers.forEach(section => { @@ -1329,7 +1334,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV a.remove(); // remove the element this.editing = false; - this.exportLoading = false; } fileChangeEvent(fileInput: any, index) { @@ -1364,7 +1368,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV return; } } - // this.loading.open(); this.makeFileRequest(this.properties.utilsService + '/upload?type=json', [], this.filesToUpload).then(async (result: string) => {