Commit c3773584 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Restore menu content when emptying the search input

parent 44817726
......@@ -18,6 +18,7 @@ class @SearchAutocomplete
# Dropdown Element
@dropdown = @wrap.find('.dropdown')
@dropdownContent = @dropdown.find('.dropdown-content')
@locationBadgeEl = @getElement('.search-location-badge')
@locationText = @getElement('.location-text')
......@@ -136,6 +137,7 @@ class @SearchAutocomplete
if e.currentTarget.value is ''
@removeLocationBadge()
@searchInput.focus()
@disableAutocomplete()
when KEYCODE.ESCAPE
if @badgePresent()
else
......@@ -239,4 +241,13 @@ class @SearchAutocomplete
disableAutocomplete: ->
if @autocomplete
@searchInput.addClass('disabled')
@dropdown.removeClass('open')
@restoreMenu()
@autocomplete = false
restoreMenu: ->
html = "<ul>
<li><a class='is-focused'>Loading...</a></li>
</ul>"
@dropdownContent.html(html)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment