From 254a4fe89cccd8eba4ac3e766289aa822d1f1252 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 26 Jan 2013 12:02:06 -0600 Subject: [PATCH] preserve outfits#edit location hash when switching locales --- public/javascripts/outfits/edit.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/javascripts/outfits/edit.js b/public/javascripts/outfits/edit.js index 23d7fd1c..9e6ea9b9 100644 --- a/public/javascripts/outfits/edit.js +++ b/public/javascripts/outfits/edit.js @@ -1296,6 +1296,13 @@ userbar_sessions_link.hover(function () { userbar_message_el.stop().fadeOut('fast'); }); +var localeForm = $('#locale-form'); +localeForm.submit(function (e) { + var fullPath = document.location.pathname + document.location.search + + document.location.hash; + localeForm.find('input[name=return_to]').val(fullPath); +}); + $.ajaxSetup({ error: function (xhr) { $.jGrowl("There was an error loading that last resource. Oops. Please try again!");