Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geolocation widget: fixing input number events #104

Merged
merged 2 commits into from
Jun 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/plugins/cordova-plugin-geolocation/sim-host-panels.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<!-- Note that this needs to be a cordova-group not a cordova-panel-row as the flex box arranging of the latter
screws up sizing of the map box in Firefox -->
<cordova-group>
<div class='geo-box'>
<div class='geo-content'>
<div class="geo-box">
<div class="geo-content">
<div id="geo-map-container"></div>
<div id="geo-map-marker"></div>
<div id="geo-map-direction">
Expand Down Expand Up @@ -57,9 +57,9 @@
<cordova-checkbox id="geo-timeout">Simulate GPS Timeout</cordova-checkbox>

<cordova-panel-row>
<cordova-label label="Navigation Simulator"></cordova-label>
<cordova-label label="Navigation Simulator"></cordova-label>
</cordova-panel-row>
<cordova-panel-row>
<cordova-panel-row>
<section>
<cordova-button id="geo-gpxfile-button" style="width:100%">Choose File</cordova-button>
<cordova-file hidden="true" id="geo-gpxfile"></cordova-file>
Expand Down
28 changes: 13 additions & 15 deletions src/plugins/cordova-plugin-geolocation/sim-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,25 +449,24 @@ module.exports = function (messages) {
_updateGpsMapZoom(true);
});

utils.bindAutoSaveEvent('#' + GEO_OPTIONS.LATITUDE, updateGeo);
utils.bindAutoSaveEvent('#' + GEO_OPTIONS.LONGITUDE, updateGeo);
utils.bindAutoSaveEvent('#' + GEO_OPTIONS.ALTITUDE, updateGeo);
utils.bindAutoSaveEvent('#' + GEO_OPTIONS.ACCURACY, updateGeo);
utils.bindAutoSaveEvent('#' + GEO_OPTIONS.ALTITUDE_ACCURACY, updateGeo);

document.querySelector('#' + GEO_OPTIONS.DELAY).addEventListener('change', function () {
latitude.addEventListener('change', updateGeo);
longitude.addEventListener('change', updateGeo);
altitude.addEventListener('change', updateGeo);
accuracy.addEventListener('change', updateGeo);
altitudeAccuracy.addEventListener('change', updateGeo);
speed.addEventListener('change', updateGeo);

delay.addEventListener('change', function () {
updateGeo();
delayLabel.value = delay.value;
});

document.querySelector('#' + GEO_OPTIONS.DELAY).addEventListener('input', function () {
delay.addEventListener('input', function () {
updateGeo();
delayLabel.value = delay.value;
});

document.querySelector('#' + GEO_OPTIONS.TIMEOUT).addEventListener('click', function () {
updateGeo();
});
timeout.addEventListener('click', updateGeo);

var gpxFileLoader = document.querySelector('#' + GEO_OPTIONS.GPXFILE);
var gpxFileButton = document.querySelector('#geo-gpxfile-button');
Expand All @@ -488,21 +487,20 @@ module.exports = function (messages) {
}
});

document.querySelector('#' + GEO_OPTIONS.GPXGO).addEventListener('click', function () {
gpxGo.addEventListener('click', function () {
replayGpxTrack();
});

document.querySelector('#' + GEO_OPTIONS.HEADING).addEventListener('change', function () {
heading.addEventListener('change', function () {
updateGeo();
updateHeadingValues();
});

document.querySelector('#' + GEO_OPTIONS.HEADING).addEventListener('input', function () {
heading.addEventListener('input', function () {
updateGeo();
updateHeadingValues();
});

utils.bindAutoSaveEvent('#' + GEO_OPTIONS.SPEED, updateGeo);
heading.value = positionInfo.heading;
speed.value = positionInfo.speed;

Expand Down