From b314d6376f8df00920b231b1904a827f03911cde Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 29 Jul 2018 00:43:12 -0700 Subject: [PATCH] Update the hrefs when saving the bookmark editor. --- frontends/etiquette_flask/templates/bookmarks.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/templates/bookmarks.html b/frontends/etiquette_flask/templates/bookmarks.html index b5b9517..c3b36b0 100644 --- a/frontends/etiquette_flask/templates/bookmarks.html +++ b/frontends/etiquette_flask/templates/bookmarks.html @@ -132,7 +132,7 @@ function on_open(ed, edit_element_map) edit_element_map["title"].focus(); } -function on_save(ed, edit_element_map) +function on_save(ed, edit_element_map, display_element_map) { var title_editor = edit_element_map["title"]; var url_editor = edit_element_map["url"]; @@ -143,10 +143,12 @@ function on_save(ed, edit_element_map) } ed.show_spinner(); - function callback() + function callback(response) { ed.hide_spinner(); ed.save(); + display_element_map["title"].href = response["data"]["url"]; + display_element_map["url"].href = response["data"]["url"]; } var url = "/bookmark/" + ed.misc_data["bookmark_id"] + "/edit";