Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload fucntion added upon adding location tags #7520

Merged
merged 5 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/assets/javascripts/tagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions test/system/post_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down