diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 4fcc0cc9a1..4563a64120 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -21,8 +21,9 @@
@@ -41,7 +42,7 @@ -
+
@@ -477,6 +478,26 @@ export default mixins( }, }, methods: { + onDisplayModeChange(displayMode: string) { + const previous = this.displayMode; + this.displayMode = displayMode; + + const dataContainer = this.$refs.dataContainer; + if (dataContainer) { + const dataDisplay = (dataContainer as Element).children[0]; + + if (dataDisplay){ + dataDisplay.scrollTo(0, 0); + } + } + + this.closeBinaryDataDisplay(); + this.$externalHooks().run('runData.displayModeChanged', { newValue: displayMode, oldValue: previous }); + if(this.node) { + const nodeType = this.node ? this.node.type : ''; + this.$telemetry.track('User changed node output view mode', { old_mode: previous, new_mode: displayMode, node_type: nodeType, workflow_id: this.$store.getters.workflowId }); + } + }, getRunLabel(option: number) { let itemsCount = 0; for (let i = 0; i <= this.maxOutputIndex; i++) { @@ -738,14 +759,6 @@ export default mixins( jsonData () { this.refreshDataSize(); }, - displayMode (newValue, oldValue) { - this.closeBinaryDataDisplay(); - this.$externalHooks().run('runData.displayModeChanged', { newValue, oldValue }); - if(this.node) { - const nodeType = this.node ? this.node.type : ''; - this.$telemetry.track('User changed node output view mode', { old_mode: oldValue, new_mode: newValue, node_type: nodeType, workflow_id: this.$store.getters.workflowId }); - } - }, maxRunIndex () { this.runIndex = Math.min(this.runIndex, this.maxRunIndex); },