diff options
author | Struan Donald <struan@exo.org.uk> | 2013-07-04 12:10:47 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-07-04 12:10:47 +0100 |
commit | ce8315b16a6babdc2faa494cf721ba7202806cde (patch) | |
tree | 7a5fdfdd094d428375690b6404788e00c06844f5 /www/js | |
parent | dbc965121422b13da1f7f272e42c74ec5a5156d4 (diff) |
make sure we don't save the unselected category prompt as the category
as that upsets our 'is this an empty draft' checking
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/views/details.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/www/js/views/details.js b/www/js/views/details.js index 4c6d96b..90d1f76 100644 --- a/www/js/views/details.js +++ b/www/js/views/details.js @@ -130,12 +130,16 @@ }, updateCurrentReport: function() { - if ( $('#form_category').val() && $('#form_title').val() && $('#form_detail').val() ) { + var category = $('#form_category').val(); + if ( category === '-- Pick a category --' ) { + category = ''; + } + if ( category && $('#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('category', category); this.model.set('title', $('#form_title').val()); this.model.set('details', $('#form_detail').val()); FMS.saveCurrentDraft(); |