aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js')
-rw-r--r--web/js/duplicates.js15
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);