aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/details.js
diff options
context:
space:
mode:
authorJedidiah Broadbent <hello@jedidiah.eu>2013-06-05 12:21:48 +0100
committerJedidiah Broadbent <hello@jedidiah.eu>2013-06-05 12:21:48 +0100
commitd66c75606d44d2352e1704e517721bfab1978605 (patch)
treeeb305905cd17e0b787653871e6b4392015e39240 /www/js/views/details.js
parent00935ce1da08124918becbe6b2d97d3b6703dc5c (diff)
parent2783aea8198eabd6d60b356695900b62cf763edf (diff)
Merge branch 'phonegap-jquery-mobile-new' of ssh://git.mysociety.org/data/git/public/fixmystreet into phonegap-jquery-mobile-new
Diffstat (limited to 'www/js/views/details.js')
-rw-r--r--www/js/views/details.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/www/js/views/details.js b/www/js/views/details.js
index 1cd0efd..17f8d68 100644
--- a/www/js/views/details.js
+++ b/www/js/views/details.js
@@ -13,18 +13,18 @@
'click .ui-btn-left': 'onClickButtonPrev',
'click .ui-btn-right': 'onClickButtonNext',
'blur textarea': 'updateCurrentReport',
- 'change select': 'updateCurrentReport',
+ 'change select': 'updateSelect',
'blur input': 'updateCurrentReport'
},
afterRender: function() {
+ this.$('#form_category').attr('data-role', 'none');
+
if ( this.model.get('category') ) {
this.$('#form_category').val( this.model.get('category') );
+ this.setSelectClass();
}
- this.$('#form_category')
- .attr('data-role', 'none')
- .addClass('noselection');
},
afterDisplay: function() {
@@ -73,6 +73,20 @@
}
},
+ setSelectClass: function() {
+ var cat = $('#form_category');
+ if ( cat.val() !== "" && cat.val() !== '-- Pick a category --' ) {
+ cat.removeClass('noselection');
+ } else {
+ cat.addClass('noselection');
+ }
+ },
+
+ updateSelect: function() {
+ this.updateCurrentReport();
+ this.setSelectClass();
+ },
+
updateCurrentReport: function() {
if ( $('#form_category').val() && $('#form_title').val() && $('#form_detail').val() ) {
$('#next').addClass('page_complete_btn');