diff options
Diffstat (limited to 'www/js/views')
-rw-r--r-- | www/js/views/details.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/www/js/views/details.js b/www/js/views/details.js index 9f03d58..f2de9d8 100644 --- a/www/js/views/details.js +++ b/www/js/views/details.js @@ -87,8 +87,18 @@ timeout: 30000, success: function( data, status ) { if ( data && data.category_extra && data.category_extra.length > 0 ) { - that.model.set('category_extras', data.category_extra); - that.navigate('details_extra'); + // Some categories have only hidden fields - in that case we + // don't want to navigate to the details_extra view. + var all_hidden = data.category_extra_json.reduce(function(accumulator, field) { + return accumulator && (field.automated === "hidden_field"); + }, true); + + if (all_hidden) { + that.navigate( that.next ); + } else { + that.model.set('category_extras', data.category_extra); + that.navigate('details_extra'); + } } else { that.navigate( that.next ); } |