aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-04-19 15:55:41 +0100
committerStruan Donald <struan@exo.org.uk>2013-04-22 15:56:00 +0100
commit85d67d2d79d01396ffe85d77d8b112874d305360 (patch)
tree26ec11cbe8902930bfe34c9be72d9d510c5ac52b
parentc87246d4b0597d25b2407c22ca26a30aa7505e1e (diff)
change the next button text to reflect if we are saving the report or skipping
-rw-r--r--www/js/views/offline.js12
-rw-r--r--www/templates/en/offline.html2
2 files changed, 12 insertions, 2 deletions
diff --git a/www/js/views/offline.js b/www/js/views/offline.js
index 6bc0134..8f963f6 100644
--- a/www/js/views/offline.js
+++ b/www/js/views/offline.js
@@ -15,7 +15,9 @@
'click #id_photo_button': 'takePhoto',
'click #id_existing': 'addPhoto',
'click #id_del_photo_button': 'deletePhoto',
- 'click #locate': 'locate'
+ 'click #locate': 'locate',
+ 'blur input': 'toggleNextButton',
+ 'blur textarea': 'toggleNextButton'
},
draftHasContent: function() {
@@ -29,6 +31,14 @@
return hasContent;
},
+ toggleNextButton: function() {
+ if ( this.draftHasContent() ) {
+ $('#offline-next-btn .ui-btn-text').text('Save');
+ } else {
+ $('#offline-next-btn .ui-btn-text').text('Skip');
+ }
+ },
+
failedLocation: function(details) {
this.finishedLocating();
this.locateCount = 21;
diff --git a/www/templates/en/offline.html b/www/templates/en/offline.html
index 38fbdaf..39e1e39 100644
--- a/www/templates/en/offline.html
+++ b/www/templates/en/offline.html
@@ -1,7 +1,7 @@
<div data-role="header" data-position="fixed" >
<a id="offline-prev-btn" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">Try Again</a>
<h1>Offline</h1>
- <a id="offline-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">Save</a>
+ <a id="offline-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">Skip</a>
</div>
<div class="table-cell">
<div id="locating" class="nodisplay" style="background: white; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 3000; text-align: center; padding-top: 50%">