aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-04-22 12:31:23 +0100
committerStruan Donald <struan@exo.org.uk>2013-04-22 15:58:16 +0100
commit8ad6d6e7b365d0433d94ebf8cc288d02d64afd3d (patch)
treed4ed9a6c7b06b0abad8549b98d67094e566c63ec
parent8daf5396fa0466cf22e7cfa6c1b0cfe7b3ccd690 (diff)
highlight next button on details page when we have filled in all the fields
-rw-r--r--www/css/mobile.css4
-rw-r--r--www/js/views/details.js7
2 files changed, 10 insertions, 1 deletions
diff --git a/www/css/mobile.css b/www/css/mobile.css
index e686405..4a76eab 100644
--- a/www/css/mobile.css
+++ b/www/css/mobile.css
@@ -225,3 +225,7 @@ ul#existing li {
#sub_map_links a {
padding: 0.6em 2em 0.5em 1em;
}
+
+.page_complete_btn {
+ background-color: rgba(231,154,0,100) !important;
+}
diff --git a/www/js/views/details.js b/www/js/views/details.js
index 54aaca9..772d4c9 100644
--- a/www/js/views/details.js
+++ b/www/js/views/details.js
@@ -11,7 +11,7 @@
'pageshow': 'afterDisplay',
'click .ui-btn-left': 'onClickButtonPrev',
'click .ui-btn-right': 'onClickButtonNext',
- 'change textarea': 'updateCurrentReport',
+ 'blur textarea': 'updateCurrentReport',
'change select': 'updateCurrentReport',
'blur input': 'updateCurrentReport'
},
@@ -59,6 +59,11 @@
},
updateCurrentReport: function() {
+ if ( $('#form_category').val() && $('#form_title').val() && $('#form_detail').val() ) {
+ $('#next').addClass('page_complete_btn');
+ } else {
+ $('#next').removeClass('page_complete_btn');
+ }
this.model.set('category', $('#form_category').val());
this.model.set('title', $('#form_title').val());
this.model.set('details', $('#form_detail').val());