diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/tfl/js.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/web/cobrands/tfl/js.js b/web/cobrands/tfl/js.js new file mode 100644 index 000000000..483e0d2ce --- /dev/null +++ b/web/cobrands/tfl/js.js @@ -0,0 +1,18 @@ +(function(){ + +$(function() { + function update_category_group_label() { + var group = $("#report_inspect_form select#category option:selected").closest("optgroup").attr('label'); + var $label = $("#report_inspect_form select#category").closest("p").find("label"); + if (group) { + $label.text("Category (" + group + ")"); + } else { + $label.text("Category"); + } + } + $(document).on('change', "#report_inspect_form select#category", update_category_group_label); + $(fixmystreet).on('display:report', update_category_group_label); + update_category_group_label(); +}); + +})(); |