diff options
author | Struan Donald <struan@exo.org.uk> | 2013-07-25 12:58:18 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-07-25 12:58:18 +0100 |
commit | a0f1bef364b191fc56464de09b776173b01dae8b (patch) | |
tree | 5e70a0d588368fd71886a326d41fae0023f28705 /src | |
parent | d575f0f19d6e7ebe159d303aafacad7a86e09867 (diff) |
move cancelling of offline locate click default up to the view the event
is for rather because locator.locate usually doesn't get an event and
it's silly to put a guard clause there
Diffstat (limited to 'src')
-rw-r--r-- | src/js/views/locator.js | 3 | ||||
-rw-r--r-- | src/js/views/offline.js | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/js/views/locator.js b/src/js/views/locator.js index b43b59f..9b630a2 100644 --- a/src/js/views/locator.js +++ b/src/js/views/locator.js @@ -3,8 +3,7 @@ LocatorView: FMS.FMSView.extend({ skipLocationCheck: false, - locate: function(e) { - e.preventDefault(); + locate: function() { $(document).delegate('.ui-content', 'touchmove', false); $('#locating').show(); this.listenTo(FMS.locator, 'gps_located', this.gotLocation); diff --git a/src/js/views/offline.js b/src/js/views/offline.js index db467a7..4a6e9c9 100644 --- a/src/js/views/offline.js +++ b/src/js/views/offline.js @@ -16,7 +16,7 @@ 'vclick #id_photo_button': 'takePhoto', 'vclick #id_existing': 'addPhoto', 'vclick #id_del_photo_button': 'deletePhoto', - 'vclick #locate': 'locate', + 'vclick #locate': 'onClickLocate', 'vclick #locate_cancel': 'onClickCancel', 'blur input': 'toggleNextButton', 'blur textarea': 'toggleNextButton' @@ -107,6 +107,11 @@ }); }, + onClickLocate: function(e) { + e.preventDefault(); + this.locate(); + }, + onClickCancel: function(e) { e.preventDefault(); this.finishedLocating(); |