diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-07-13 09:40:46 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-07-13 09:40:48 +0100 |
commit | de0d60de2bffe4721d2a35d29efb418cc6f9fb35 (patch) | |
tree | 0a2d4fc81ccdeabb99afdb74f3c51d6eec6489d3 | |
parent | eea617238d38227d7dc444170d5ce047d155c20f (diff) |
Don't set up multiple handlers on drawers.
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 886c90aae..10d7f59ac 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -55,6 +55,7 @@ function isR2L() { var $swparent = $sw.parent(); var $drawer = $('#' + id); + this.off('click'); this.toggle(function() { // Find the specified drawer, or create it if it doesn't exist if ($drawer.length === 0) { @@ -584,7 +585,8 @@ $.extend(fixmystreet.set_up, { map_sidebar_key_tools: function() { if ($('html.mobile').length) { $('#council_wards').hide().removeClass('hidden-js').find('h2').hide(); - $('#key-tool-wards').click(function(e) { + $('#key-tool-wards').off('click.wards'); + $('#key-tool-wards').on('click.wards', function(e) { e.preventDefault(); $('#council_wards').slideToggle('800', function() { $('#key-tool-wards').toggleClass('hover'); |