main.js
1.46 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Created by vitaliy on 23.11.15.
*/
function clearFixedMenuPAdding(item_id){
$(item_id).on('show.bs.modal', function(){
$('.another_menu').css({transition: 'none'});
$('.another_menu').css({paddingRight: '15px'});
});
$(item_id).on('hidden.bs.modal', function(){
$('.another_menu').css({paddingRight: '0px'});
})
}
$(document).ready(function(){
clearFixedMenuPAdding('#details_content_block');
$('#accountsform-country').change(function(){
var region_id = $(this).val();
if(region_id){
$.get( "/ajax/get-city", {region_id:region_id}, function( data ) {
var $input = $('#accounts-city');
$input.empty();
$input.append(data);
});
}
});
$('#company').click(function(){
$(this).addClass('active_button');
$('#person').removeClass('active_button');
$('#accountsform-company').attr('type', 'text').attr('placeholder', 'Компания').val('');
$('.field-accountsform-company').css('display','block');
$('#accountsform-is_firm').val('1');
});
$('#person').click(function(){
$('#company').removeClass('active_button');
$(this).addClass('active_button');
$('.field-accountsform-company').css('display','none');
$('#accountsform-company').attr('type', 'hidden').val('Частное лицо');
$('#accountsform-is_firm').val('0');
});
});