diff --git a/app/assets/javascripts/tagging.js b/app/assets/javascripts/tagging.js index 54a22937d8..6fb580cab1 100644 --- a/app/assets/javascripts/tagging.js +++ b/app/assets/javascripts/tagging.js @@ -72,6 +72,10 @@ function addNewTagsSuccess(response, deletion_path, el = "#tagform"){ if (typeof response == "string") response = JSON.parse(response) $.each(response['saved'], function(i, tag) { // only display tag if it was added to the note we're currently viewing + var tagNameCheck = !!tag[0].split(':')[0].match(/^(lat|lon|place)$/) + if (tagNameCheck) { + location.reload(true); + } if (tag[2] == getDeletionPathId(deletion_path)) { displayNewTag(tag[0], tag[1], deletion_path); } diff --git a/test/system/post_test.rb b/test/system/post_test.rb index 88936f7e21..3bc18e7c43 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -208,6 +208,7 @@ def assert_page_does_not_reload(message = "page should not reload") # Wait for the location to be added wait_for_ajax + find('.tags-list a.show-more-tags').click() # Make sure proper latitude and longitude tags are added assert_selector('.tags-list .badge a[href="/tag/lat:22"]', text: "lat:22")