aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/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');