Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed elements

  • Loading branch information...
commit 560a69fa995cec8ce96cdcd0f7dcb6c9f033ef32 1 parent 820c62d
@rjshade rjshade authored
Showing with 13 additions and 13 deletions.
  1. +1 −1  css/main.css
  2. +3 −3 index.html
  3. +9 −9 js/gmaps.js
View
2  css/main.css
@@ -82,7 +82,7 @@ input {
padding-bottom: 20px;
color: #ccc;
}
-#input #latitude, #input #longitude {
+#input #gmaps-output-latitude, #input #gmaps-output-longitude {
color: green;
}
View
6 index.html
@@ -45,12 +45,12 @@
<hr/>
<div id='input'>
- <input id='address' placeholder='Start typing a place name...' type='text' />
+ <input id='gmaps-input-address' placeholder='Start typing a place name...' type='text' />
<br/>
<br/>
- Latitude: <span id='latitude'></span>
+ Latitude: <span id='gmaps-output-latitude'></span>
<br/>
- Longitude: <span id='longitude'></span>
+ Longitude: <span id='gmaps-output-longitude'></span>
<br/>
<div id='gmaps-error'></div>
View
18 js/gmaps.js
@@ -46,10 +46,10 @@ function update_map( geometry ) {
// fill in the UI elements with new position data
function update_ui( address, latLng ) {
- $('#address').autocomplete("close");
- $('#address').val(address);
- $('#latitude').html(latLng.lat());
- $('#longitude').html(latLng.lng());
+ $('#gmaps-input-address').autocomplete("close");
+ $('#gmaps-input-address').val(address);
+ $('#gmaps-output-latitude').html(latLng.lat());
+ $('#gmaps-output-longitude').html(latLng.lng());
}
// Query the Google geocode object
@@ -102,7 +102,7 @@ function geocode_lookup( type, value, update ) {
// initialise the jqueryUI autocomplete element
function autocomplete_init() {
- $("#address").autocomplete({
+ $("#gmaps-input-address").autocomplete({
// source is the list of input options shown in the autocomplete dropdown.
// see documentation: http://jqueryui.com/demos/autocomplete/
@@ -130,15 +130,15 @@ function autocomplete_init() {
});
// triggered when user presses a key in the address box
- $("#address").bind('keydown', function(event) {
+ $("#gmaps-input-address").bind('keydown', function(event) {
if(event.keyCode == 13) {
- geocode_lookup( 'address', $('#address').val(), true );
+ geocode_lookup( 'address', $('#gmaps-input-address').val(), true );
// ensures dropdown disappears when enter is pressed
- $('#address').autocomplete("disable")
+ $('#gmaps-input-address').autocomplete("disable")
} else {
// re-enable if previously disabled above
- $('#address').autocomplete("enable")
+ $('#gmaps-input-address').autocomplete("enable")
}
});
}; // autocomplete_init
Please sign in to comment.
Something went wrong with that request. Please try again.