mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
95f7b9205a
commit
d9502a6c00
@ -346,6 +346,10 @@
|
|||||||
},100);
|
},100);
|
||||||
}
|
}
|
||||||
that._trigger("sort",null,item);
|
that._trigger("sort",null,item);
|
||||||
|
|
||||||
|
if (that.activeFilter) {
|
||||||
|
that.filter(that.activeFilter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.treeList.addChild = function(newItem,select) {
|
item.treeList.addChild = function(newItem,select) {
|
||||||
@ -772,7 +776,8 @@
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filter: function(filterFunc,expandResults) {
|
filter: function(filterFunc) {
|
||||||
|
this.activeFilter = filterFunc;
|
||||||
var totalCount = 0;
|
var totalCount = 0;
|
||||||
var filter = function(item) {
|
var filter = function(item) {
|
||||||
var matchCount = 0;
|
var matchCount = 0;
|
||||||
|
@ -2,6 +2,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
|
|
||||||
var treeList;
|
var treeList;
|
||||||
var searchInput;
|
var searchInput;
|
||||||
|
var activeSearch;
|
||||||
var projectInfo;
|
var projectInfo;
|
||||||
var projectInfoLabel;
|
var projectInfoLabel;
|
||||||
var flowList;
|
var flowList;
|
||||||
@ -212,6 +213,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
var val = $(this).val();
|
var val = $(this).val();
|
||||||
var searchResults = RED.search.search(val);
|
var searchResults = RED.search.search(val);
|
||||||
if (val) {
|
if (val) {
|
||||||
|
activeSearch = val;
|
||||||
var resultMap = {};
|
var resultMap = {};
|
||||||
for (var i=0,l=searchResults.length;i<l;i++) {
|
for (var i=0,l=searchResults.length;i<l;i++) {
|
||||||
resultMap[searchResults[i].node.id] = true;
|
resultMap[searchResults[i].node.id] = true;
|
||||||
@ -223,6 +225,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
return item.id && objects[item.id] && resultMap[item.id]
|
return item.id && objects[item.id] && resultMap[item.id]
|
||||||
},true)
|
},true)
|
||||||
} else {
|
} else {
|
||||||
|
activeSearch = null;
|
||||||
treeList.treeList('filter',null);
|
treeList.treeList('filter',null);
|
||||||
var selected = treeList.treeList('selected');
|
var selected = treeList.treeList('selected');
|
||||||
if (selected.id) {
|
if (selected.id) {
|
||||||
@ -308,7 +311,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
flowList.treeList.addChild(objects[ws.id])
|
flowList.treeList.addChild(objects[ws.id])
|
||||||
objects[ws.id].element.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
|
objects[ws.id].element.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
|
||||||
objects[ws.id].treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
|
objects[ws.id].treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
|
||||||
|
updateSearch();
|
||||||
|
|
||||||
}
|
}
|
||||||
function onFlowChange(n) {
|
function onFlowChange(n) {
|
||||||
@ -322,6 +325,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
existingObject.element.find(".red-ui-info-outline-item-label").text(label);
|
existingObject.element.find(".red-ui-info-outline-item-label").text(label);
|
||||||
existingObject.element.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
|
existingObject.element.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
|
||||||
existingObject.treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
|
existingObject.treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
|
||||||
|
updateSearch();
|
||||||
}
|
}
|
||||||
function onFlowsReorder(order) {
|
function onFlowsReorder(order) {
|
||||||
var indexMap = {};
|
var indexMap = {};
|
||||||
@ -350,6 +354,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
objects[sf.id].children.push(getEmptyItem(sf.id));
|
objects[sf.id].children.push(getEmptyItem(sf.id));
|
||||||
}
|
}
|
||||||
subflowList.treeList.addChild(objects[sf.id])
|
subflowList.treeList.addChild(objects[sf.id])
|
||||||
|
updateSearch();
|
||||||
}
|
}
|
||||||
function onSubflowChange(sf) {
|
function onSubflowChange(sf) {
|
||||||
var existingObject = objects[sf.id];
|
var existingObject = objects[sf.id];
|
||||||
@ -361,6 +366,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
sfInstance.treeList.replaceElement(getNodeLabel(n));
|
sfInstance.treeList.replaceElement(getNodeLabel(n));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
updateSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onNodeChange(n) {
|
function onNodeChange(n) {
|
||||||
@ -386,6 +392,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
existingObject.element.toggleClass("red-ui-info-outline-item-disabled", !!n.d)
|
existingObject.element.toggleClass("red-ui-info-outline-item-disabled", !!n.d)
|
||||||
|
updateSearch();
|
||||||
}
|
}
|
||||||
function onObjectRemove(n) {
|
function onObjectRemove(n) {
|
||||||
var existingObject = objects[n.id];
|
var existingObject = objects[n.id];
|
||||||
@ -447,8 +454,20 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
globalConfigNodes.treeList.addChild(objects[n.id])
|
globalConfigNodes.treeList.addChild(objects[n.id])
|
||||||
}
|
}
|
||||||
objects[n.id].element.toggleClass("red-ui-info-outline-item-disabled", !!n.d)
|
objects[n.id].element.toggleClass("red-ui-info-outline-item-disabled", !!n.d)
|
||||||
|
updateSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var updateSearchTimer;
|
||||||
|
function updateSearch() {
|
||||||
|
if (updateSearchTimer) {
|
||||||
|
clearTimeout(updateSearchTimer)
|
||||||
|
}
|
||||||
|
if (activeSearch) {
|
||||||
|
updateSearchTimer = setTimeout(function() {
|
||||||
|
searchInput.searchBox("change");
|
||||||
|
},100);
|
||||||
|
}
|
||||||
|
}
|
||||||
function onSelectionChanged(selection) {
|
function onSelectionChanged(selection) {
|
||||||
// treeList.treeList('clearSelection');
|
// treeList.treeList('clearSelection');
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
border: 1px dashed $primary-border-color;
|
border: 1px dashed $primary-border-color;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.red-ui-search-results-container {
|
.red-ui-search-results-container {
|
||||||
display: none;
|
display: none;
|
||||||
|
Loading…
Reference in New Issue
Block a user