armen_asriyan (armen_asriyan) wrote in changelog,
armen_asriyan
armen_asriyan
changelog

[livejournal] r22870: LJSUP-13551: Doesn't save account settin...

Committer: aasriyan
LJSUP-13551: Doesn't save account settings

U   trunk/htdocs/js/settings.js
Modified: trunk/htdocs/js/settings.js
===================================================================
--- trunk/htdocs/js/settings.js	2012-09-12 07:20:26 UTC (rev 22869)
+++ trunk/htdocs/js/settings.js	2012-09-12 07:22:54 UTC (rev 22870)
@@ -9,12 +9,19 @@
 		confirm_msg: LiveJournal.getLocalizedStr('.form.confirm', null, 'Save your changes?'),
 		form_changed: false,
 		navclickSave: function(e) {
-			if (!Settings.form_changed || e.isDefaultPrevented() || this.target === '_blank') {
-				return;
+			
+			if ( Settings.form_changed  && confirm(Settings.confirm_msg) ) {
+				
+				e.preventDefault();
+				
+				var redirectVal = $(e.target).attr('href');
+				
+				if ( redirectVal ) {
+					Settings.$form.append('<input type="hidden" name="redirect_to" value="' + redirectVal + '">');
+				}
+				
+				Settings.$form.submit();
 			}
-
-			var confirmed = confirm(Settings.confirm_msg);
-			confirmed && Settings.$form.submit();
 		}
 	};
 

Tags: aasriyan, armen_asriyan, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments