diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/staff.js | 14 | ||||
-rw-r--r-- | web/cobrands/sass/_base.scss | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js index 07a2729e2..c3d1650a6 100644 --- a/web/cobrands/fixmystreet/staff.js +++ b/web/cobrands/fixmystreet/staff.js @@ -299,6 +299,20 @@ $.extend(fixmystreet.set_up, { toggle_public_update(); }); + if ($('#detailed_information').data('max-length')) { + $('#detailed_information').on('keyup', function() { + var $this = $(this), + counter = $('#detailed_information_length'); + var chars_left = $this.data('max-length') - $this.val().length; + counter.html(chars_left); + if (chars_left < 0) { + counter.addClass('error'); + } else { + counter.removeClass('error'); + } + }); + } + if (geo_position_js.init()) { fixmystreet.geolocate.setup(function(pos) { var latlon = new OpenLayers.LonLat(pos.coords.longitude, pos.coords.latitude); diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss index d02efe489..ce28badab 100644 --- a/web/cobrands/sass/_base.scss +++ b/web/cobrands/sass/_base.scss @@ -1863,6 +1863,13 @@ label .muted { padding: 1em; margin: 0 -1em; background-color: #E9F2FF; + + #detailed_information_length { + float: right; + &.error { + color: red; + } + } } .inspect-form-heading { |