From 37b3601c47a2621f75ab0de3ca45fd7b1e05445c Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 6 Feb 2019 15:38:35 +0000 Subject: [PATCH] Link Node - scroll to current flow in node list --- .../editor-client/src/js/ui/common/editableList.js | 8 ++++++++ .../editor-client/src/js/ui/common/treeList.js | 7 +++++++ .../@node-red/nodes/core/core/60-link.html | 11 +++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js index 975c8c300..ee29a6a35 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js @@ -327,6 +327,14 @@ }, length: function() { return this.element.children().length; + }, + show: function(item) { + var items = this.element.children().filter(function(f) { + return item === $(this).find(".red-ui-editableList-item-content").data('data'); + }); + if (items.length > 0) { + this.uiContainer.scrollTop(this.uiContainer.scrollTop()+items.position().top) + } } }); })(jQuery); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js index e139257f7..94dafb4e7 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js @@ -171,6 +171,13 @@ } else { return this._data; } + }, + show: function(id) { + for (var i=0;i 0 }) - treeList.treeList('data',flows) + treeList.treeList('data',flows); + setTimeout(function() { + treeList.treeList('show',node.z); + },100); } function resizeNodeList() {