aboutsummaryrefslogtreecommitdiff
path: root/views/default/openid_client/js.php
blob: 171215593e405fd217cf3a89f9a2e0809ba3503c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/**
 * OpenID JavaScript
 */

?>

// OpenID toggle
elgg.register_hook_handler('init', 'system', function() {
	$('.openid-login-icon').click(function(e) {
		var openid_box = $(this).prev('.elgg-form-openid-client-login');
		var shown = openid_box.is(':visible') ? openid_box : openid_box.prev(); 
		var hidden = !openid_box.is(':visible') ? openid_box : openid_box.prev();
		shown.fadeOut(function() {
			hidden.fadeIn();
		});
		e.preventDefault();
	});
	$(".elgg-form-openid-client-login [name='openid_provider']").change(function(event) {
		if (this.value == 'others') {
			$(".openid-client-url").slideDown().find('input').focus();
		} else {
			$(".openid-client-url").slideUp();
		}
	});
});