Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

Commit

Permalink
Added placeholder text to location search input; clear input after se…
Browse files Browse the repository at this point in the history
…arch
  • Loading branch information
brianchirls committed Dec 17, 2014
1 parent 481f8a2 commit 08b7327
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<button id="fs">FS</button>
<button id="vr" disabled>VR</button>
<span>
<input id="location" type="text"/>
<input id="location" type="text" placeholder="Search for a location"/>
<button id="search">Go</button>
</span>
</div>
Expand Down
7 changes: 5 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
infobutton = document.getElementById('infobutton'),
info = document.getElementById('info'),
searchbutton = document.getElementById('search'),
locationInput = document.getElementById('location'),

locationCache = {},

Expand Down Expand Up @@ -340,6 +341,10 @@
locationName.appendChild(document.createTextNode(loc.display_name));
}

if (locationInput !== document.activeElement) {
locationInput.value = '';
}

//todo: update query param in URL
}

Expand Down Expand Up @@ -469,8 +474,6 @@
}

function init() {
var locationInput = document.getElementById('location');

parseQuery();
initVizi();
initScene();
Expand Down

0 comments on commit 08b7327

Please sign in to comment.