Sfoglia il codice sorgente

Find dialog changes

Lutz Roeder 7 anni fa
parent
commit
232125f329
2 ha cambiato i file con 9 aggiunte e 11 eliminazioni
  1. 0 2
      src/view-find.css
  2. 9 9
      src/view-find.js

+ 0 - 2
src/view-find.css

@@ -11,8 +11,6 @@
 
 .find ol {
     list-style-type: none;
-    border-radius: 4px;
-    border: 1px solid #ccc;
     overflow-y: auto;
     margin: 8px 0 20px 0;
     padding: 0;

+ 9 - 9
src/view-find.js

@@ -83,15 +83,6 @@ class FindView {
         var edgeMatches = {};
 
         this._graph.nodes.forEach((node) => {
-            var name = node.name;
-            if (name && name.toLowerCase().indexOf(text) != -1 && !nodeMatches[name]) {
-                var item = document.createElement('li');
-                item.innerText = '\u25A2 ' + node.name;
-                item.id = 'node-' + node.name;
-                this._resultElement.appendChild(item);
-                nodeMatches[node.name] = true;
-            }
-
             node.inputs.forEach((input) => {
                 input.connections.forEach((connection) => {
                     if (connection.id && connection.id.toLowerCase().indexOf(text) != -1 && !edgeMatches[connection.id]) {
@@ -105,6 +96,15 @@ class FindView {
                     }    
                 });
             });
+
+            var name = node.name;
+            if (name && name.toLowerCase().indexOf(text) != -1 && !nodeMatches[name]) {
+                var item = document.createElement('li');
+                item.innerText = '\u25A2 ' + node.name;
+                item.id = 'node-' + node.name;
+                this._resultElement.appendChild(item);
+                nodeMatches[node.name] = true;
+            }
         });
 
         this._graph.nodes.forEach((node) => {