changeset 2914:80e237a83e9d

fixes #494 Refreshes the page with changed language after user changes the language from settings page. Added an id to the form name `usersettings_personal` to identify if the this particular form [where language options are] was changed. If yes , reload the page.
author Yask Srivastava <yask123@gmail.com>
date Fri, 20 Feb 2015 01:50:28 +0530
parents 84564fc20d3a
children 0b30aa1fa138
files MoinMoin/static/js/common.js MoinMoin/templates/usersettings_forms.html
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/static/js/common.js	Thu Feb 19 00:24:31 2015 +0530
+++ b/MoinMoin/static/js/common.js	Fri Feb 20 01:50:28 2015 +0530
@@ -394,8 +394,8 @@
             newform.data('initialForm', newform.serialize());
             // replace the old form with the new one
             form.replaceWith(newform);
-            if (ev.currentTarget.name === 'usersettings_ui') {
-                // theme has changed, show user the new theme
+            if (ev.currentTarget.name === 'usersettings_ui' ||  ev.currentTarget.id === 'usersettings_personal') {
+                // theme or language may have changed, show user the new theme/language
                 location.reload(true);
             }
         }, 'json');
--- a/MoinMoin/templates/usersettings_forms.html	Thu Feb 19 00:24:31 2015 +0530
+++ b/MoinMoin/templates/usersettings_forms.html	Fri Feb 20 01:50:28 2015 +0530
@@ -1,7 +1,7 @@
 {% import "forms.html" as forms %}
 
 {% macro personal(form) %}
-    {{ gen.form.open(form, method="post", action=url_for('frontend.usersettings')) }}
+    {{ gen.form.open(form,id="usersettings_personal",method="post", action=url_for('frontend.usersettings')) }}
         {{ forms.render_errors(form) }}
         <dl>
             {{ forms.render(form['name']) }}