diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-06 09:02:06 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-06 09:06:06 +0200 |
| commit | 1fe63561a81290c8afd3afc47674402194d9651d (patch) | |
| tree | 0507aa77a09d91c66fd8e8a69dd9504c785dc8f5 | |
| parent | d8270e9f90dd750cda53b4170b8338bcce31fb28 (diff) | |
completer: hide unless 1 or more elements; Fixes #185
| -rw-r--r-- | index.html | 2 | ||||
| -rw-r--r-- | src/view/completer.js | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -47,7 +47,7 @@ <input class="input-bar" id="textanalyser" placeholder="Add nodes and relationships"/> <button class="add-button"></button> </form> - <div class="suggestion"> + <div class="suggestion" style="display: none"> </div> </div> <div class="info-container"> diff --git a/src/view/completer.js b/src/view/completer.js index 7cf20d05..675774d8 100644 --- a/src/view/completer.js +++ b/src/view/completer.js @@ -68,6 +68,7 @@ var completer = (function (input_element, dropdown) { var hash = text.slice(0, cursor).lastIndexOf(triggerStart); // TODO check if current completion has been invalidated _invalidateSelection(); + dropdown.hide(); dropdown_raw.innerHTML = ""; // remove all elements if (hash == -1) { return; @@ -87,6 +88,9 @@ var completer = (function (input_element, dropdown) { }); completion_start = hash + 1; completion_end = space; + if (dropdown.children().length > 0) { + dropdown.show(); + } } function _invalidateSelection() { |
