Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r21464: LJSUP-11421: Cliend-side development for...

Committer: vkurkin
LJSUP-11421: Cliend-side development for Trava.ru
U   trunk/htdocs/js/settings.js
Modified: trunk/htdocs/js/settings.js
===================================================================
--- trunk/htdocs/js/settings.js	2012-03-20 06:46:08 UTC (rev 21463)
+++ trunk/htdocs/js/settings.js	2012-03-20 07:01:16 UTC (rev 21464)
@@ -40,8 +40,9 @@
 		},
 		classNames: {
 			login: 'music-settings-login',
-			logout: 'music-settings-logout',
-			loading: 'music-settings-loading'
+			disconnect: 'music-settings-disconnect',
+			loading: 'music-settings-loading',
+			error: 'music-settings-error'
 		},
 		url: {
 			trava: 'http://trava.ru/json/autologin'
@@ -53,11 +54,13 @@
 	function onGetUserData(data) {
 		travaElement
 			.removeClass(options.classNames.loading)
-			.addClass(data.uid == 1 ? options.classNames.logout : options.classNames.login);
+			.removeClass(options.classNames.error)
+			.addClass(data.uid === 1 ? options.classNames.disconnect : options.classNames.login);
 		$(options.selectors.uIdInput).val(data.uid);
 	}
 
-	function errorGetUserData(data) {
+	function errorGetUserData() {
+		travaElement.addClass(options.classNames.error);
 		travaElement.removeClass(options.classNames.loading);
 	}
 
@@ -67,7 +70,7 @@
 
 		$(oldID).hide();
 		$(currentID).show();
-	});
+	}).trigger('change');
 
 
 	travaElement.delegate(options.selectors.connectLink, 'click', function (evt) {

Tags: b_vladi, js, livejournal, vkurkin
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