diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-23 12:51:45 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-28 14:37:11 +0100 |
commit | d6f264c35a4aef78e1c9df75a63aee0eecbd9a7b (patch) | |
tree | 621676faaf03be22cdaebd184aa7f829d31803b3 /web/js | |
parent | 475809c40225901bfa363690a1a3ae4740548684 (diff) |
Have duplicate and asset messages work together.
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/duplicates.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/web/js/duplicates.js b/web/js/duplicates.js index ff1f0bd47..0844cb5f3 100644 --- a/web/js/duplicates.js +++ b/web/js/duplicates.js @@ -36,7 +36,7 @@ data: url_params, dataType: 'json' }).done(function(response) { - if ( response.pins.length ){ + if (response.pins.length && take_effect()) { render_duplicate_list(response); render_duplicate_pins(response); } else { @@ -132,7 +132,7 @@ $(this).addClass('hidden'); $(this).find('ul').empty(); }); - if ( $('#problem_form').length ) { + if ($('#problem_form').length && take_effect()) { $('.js-hide-if-invalid-category').slideDown(); } } @@ -158,6 +158,17 @@ refresh_duplicate_list(); } + function take_effect() { + // We do not want to do anything if any other message is being shown + if (document.getElementById('js-category-stopper')) { + return false; + } + if ($('.js-responsibility-message:visible').length) { + return false; + } + return true; + } + // Want to show potential duplicates when a regular user starts a new // report, or changes the category/location of a partial report. $(fixmystreet).on('report_new:category_change', refresh_duplicate_list); |