forked from binary-com/binary-static
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.js
More file actions
40 lines (37 loc) · 1.28 KB
/
client.js
File metadata and controls
40 lines (37 loc) · 1.28 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//// togglePromoCodeTnC ////////////////////////////////////////////
//
// triggered when the promocode field on the account opening form
// loses focus. If a promocode is entered, additional T&C will be
// shown, and the Client will have to agree to them when opening
// the account.
//
////////////////////////////////////////////////////////////////////
var togglePromoCodeTnC = function(event)
{
var o = $(event.target);
if (o.val() !== '')
{
$('#formlayout').find('#comment').find('span').removeClass('invisible');
}
else
{
$('#formlayout').find('#comment').find('span').addClass('invisible');
}
};
var client_form;
onLoad.queue(function() {
client_form = new ClientForm({restricted_countries: page.settings.get('restricted_countries'), valid_loginids: page.settings.get('valid_loginids')});
});
pjax_config_page('linkto_acopening', function() {
return {
onLoad: function() {
$('#promotionalcode').blur(togglePromoCodeTnC);
client_form.on_residence_change();
select_user_country();
if(page.client.is_logged_in) {
client_form.set_virtual_login_id(page.client.loginid);
client_form.set_virtual_email_id(page.client.email);
}
}
};
});