mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #2588 from node-red/status-filter-nodes
Add compact searchBox to status/catch/complete nodes
This commit is contained in:
@@ -38,6 +38,11 @@
|
||||
this.element.addClass("red-ui-searchBox-input");
|
||||
this.uiContainer = this.element.wrap("<div>").parent();
|
||||
this.uiContainer.addClass("red-ui-searchBox-container");
|
||||
|
||||
if (this.options.style === "compact") {
|
||||
this.uiContainer.addClass("red-ui-searchBox-compact");
|
||||
}
|
||||
|
||||
if (this.element.parents("form").length === 0) {
|
||||
var form = this.element.wrap("<form>").parent();
|
||||
form.addClass("red-ui-searchBox-form");
|
||||
|
@@ -773,10 +773,12 @@
|
||||
}
|
||||
},
|
||||
filter: function(filterFunc,expandResults) {
|
||||
var totalCount = 0;
|
||||
var filter = function(item) {
|
||||
var matchCount = 0;
|
||||
if (filterFunc && filterFunc(item)) {
|
||||
matchCount++;
|
||||
totalCount++;
|
||||
}
|
||||
var childCount = 0;
|
||||
if (item.children && typeof item.children !== "function") {
|
||||
@@ -799,11 +801,13 @@
|
||||
}
|
||||
}
|
||||
if (!filterFunc) {
|
||||
totalCount++;
|
||||
return true
|
||||
}
|
||||
return matchCount > 0
|
||||
}
|
||||
return this._topList.editableList('filter', filter);
|
||||
this._topList.editableList('filter', filter);
|
||||
return totalCount;
|
||||
},
|
||||
get: function(id) {
|
||||
return this._items[id] || null;
|
||||
|
@@ -202,6 +202,7 @@ RED.sidebar.info.outliner = (function() {
|
||||
var toolbar = $("<div>", {class:"red-ui-sidebar-header red-ui-info-toolbar"}).appendTo(container);
|
||||
|
||||
searchInput = $('<input type="text" data-i18n="[placeholder]menu.label.search">').appendTo(toolbar).searchBox({
|
||||
style: "compact",
|
||||
delay: 300,
|
||||
change: function() {
|
||||
var val = $(this).val();
|
||||
|
@@ -504,18 +504,6 @@ div.red-ui-info-table {
|
||||
width: calc(100% - 150px);
|
||||
max-width: 250px;
|
||||
background: $palette-header-background;
|
||||
input.red-ui-searchBox-input {
|
||||
border: 1px solid $secondary-border-color;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
height: 26px;
|
||||
}
|
||||
input:focus.red-ui-searchBox-input {
|
||||
border: 1px solid $secondary-border-color;
|
||||
}
|
||||
i.fa-search, i.fa-times {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -71,3 +71,18 @@
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
.red-ui-searchBox-compact {
|
||||
input.red-ui-searchBox-input,input:focus.red-ui-searchBox-input {
|
||||
border: 1px solid $secondary-border-color;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
height: 26px;
|
||||
}
|
||||
i.fa-times,i.fa-search {
|
||||
top: 7px;
|
||||
}
|
||||
.red-ui-searchBox-resultCount {
|
||||
top: 3px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user