mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 15:34:26 +01:00
Do not use css display when counting filtered palette nodes
This commit is contained in:
@@ -80,7 +80,7 @@ RED.palette = (function() {
|
||||
getNodeCount: function (visibleOnly) {
|
||||
const nodes = catDiv.find(".red-ui-palette-node")
|
||||
if (visibleOnly) {
|
||||
return nodes.filter(function() { return $(this).css('display') !== 'none'}).length
|
||||
return nodes.filter(function() { return $(this).attr("data-filter") !== "true"}).length
|
||||
} else {
|
||||
return nodes.length
|
||||
}
|
||||
@@ -572,8 +572,10 @@ RED.palette = (function() {
|
||||
var currentLabel = $(el).attr("data-palette-label");
|
||||
var type = $(el).attr("data-palette-type");
|
||||
if (val === "" || re.test(type) || re.test(currentLabel)) {
|
||||
$(el).attr("data-filter", null)
|
||||
$(this).show();
|
||||
} else {
|
||||
$(el).attr("data-filter", "true")
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user