From fb562bb41559234bbf9701e73eb6695aa3a54853 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 21 Jan 2023 14:55:06 +0100 Subject: [PATCH] Propagate the @update event to the parent entities --- .../src/components/panels/Entities/Entity.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue b/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue index 54b1524f..0bc56626 100644 --- a/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue +++ b/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue @@ -2,7 +2,7 @@
+ :class="{ 'with-children': hasChildren, collapsed: isCollapsed, blink: justUpdated }">
@@ -95,7 +96,13 @@ export default { // Propagate the collapsed state to the wrapped component if applicable if (this.instance) this.instance.collapsed = !this.instance.collapsed - } + }, + + setJustUpdated() { + this.justUpdated = true + const self = this; + setTimeout(() => self.justUpdated = false, 1000) + }, }, mounted() { @@ -110,9 +117,8 @@ export default { if (this.valuesEqual(oldValue, newValue)) return false - this.justUpdated = true - const self = this; - setTimeout(() => self.justUpdated = false, 1000) + this.setJustUpdated() + this.$emit('update', {value: newValue}) } )