|
1 |
| -/*! locationpicker.jquery - v0.11.0 - 2015-01-03 */ |
| 1 | +/*! jquery-locationpicker - v0.11.0 - 2015-01-04 */ |
2 | 2 | (function($) {
|
3 | 3 | function GMapContext(domElement, options) {
|
4 | 4 | var _map = new google.maps.Map(domElement, options);
|
|
132 | 132 | function setupInputListenersInput(inputBinding, gmapContext) {
|
133 | 133 | if (inputBinding) {
|
134 | 134 | if (inputBinding.radiusInput) {
|
135 |
| - inputBinding.radiusInput.on("change", function() { |
| 135 | + inputBinding.radiusInput.on("change", function(e) { |
| 136 | + if (!e.originalEvent) { |
| 137 | + return; |
| 138 | + } |
136 | 139 | gmapContext.radius = $(this).val();
|
137 | 140 | GmUtility.setPosition(gmapContext, gmapContext.location, function(context) {
|
138 | 141 | context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
|
154 | 157 | });
|
155 | 158 | }
|
156 | 159 | if (inputBinding.latitudeInput) {
|
157 |
| - inputBinding.latitudeInput.on("change", function() { |
| 160 | + inputBinding.latitudeInput.on("change", function(e) { |
| 161 | + if (!e.originalEvent) { |
| 162 | + return; |
| 163 | + } |
158 | 164 | GmUtility.setPosition(gmapContext, new google.maps.LatLng($(this).val(), gmapContext.location.lng()), function(context) {
|
159 | 165 | context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
160 | 166 | });
|
161 | 167 | });
|
162 | 168 | }
|
163 | 169 | if (inputBinding.longitudeInput) {
|
164 |
| - inputBinding.longitudeInput.on("change", function() { |
| 170 | + inputBinding.longitudeInput.on("change", function(e) { |
| 171 | + if (!e.originalEvent) { |
| 172 | + return; |
| 173 | + } |
165 | 174 | GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), $(this).val()), function(context) {
|
166 | 175 | context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
|
167 | 176 | });
|
|
250 | 259 | updateInputValues(settings.inputBinding, gmapContext);
|
251 | 260 | context.settings.oninitialized($target);
|
252 | 261 | var currentLocation = GmUtility.locationFromLatLng(gmapContext.location);
|
| 262 | + setupInputListenersInput(settings.inputBinding, gmapContext); |
253 | 263 | });
|
254 |
| - setupInputListenersInput(settings.inputBinding, gmapContext); |
255 | 264 | });
|
256 | 265 | };
|
257 | 266 | $.fn.locationpicker.defaults = {
|
|
0 commit comments