3bc9af21
Yarik
Layout
|
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
|
$(document).ready(function(){
footer();
cabinet();
formsHome();
function footer(){
footerBottom();
resizeFooterBottom();
function footerBottom(){
var heightHeader = $('.section-box-header').height()
var heightFooter = $('.section-box-footer').height()
var windowHeight = $(window).height()
$('.section-box-content').css({minHeight:windowHeight-heightHeader-heightFooter})
}
function resizeFooterBottom(){
$(window).resize(function(){
footerBottom();
})
}
}
function cabinet() {
sidebar();
forms();
tabsContentOiv();
function sidebar() {
|
3bc9af21
Yarik
Layout
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
}
function forms() {
if($('.phone-input input').length){
$('.phone-input input').mask('+38 (000) 000 00 00');
}
}
function tabsContentOiv() {
$('.oiv-list li').click(function (e) {
e.preventDefault()
if($(this).hasClass('active-list-oiv')){
} else {
$('.table-wrapp-2').after('<div id="preload-cab"><div></div></div>')
$('.oiv-list li').removeClass('active-list-oiv')
$(this).addClass('active-list-oiv')
var thisNum = $(this).index()
var cabContent = $('.hidden-tables-oiv')
setTimeout(function () {
cabContent.removeClass('active-tab-oiv')
$(cabContent[thisNum]).addClass('active-tab-oiv')
$('#preload-cab').remove()
},800)
}
})
}
}
function formsHome() {
$('.btn_login, .btn_login_2').click(function (e) {
e.preventDefault()
var pos = ($(window).scrollTop())+20
$('#overlay').fadeIn(400,
function(){
$('#login_form')
.css('display', 'block')
.animate({opacity: 1, top: pos}, 200);
});
})
$('#modal_close, #overlay').click( function(){
$('.forms_').animate({opacity: 0, top: '0'}, 200,function(){
$(this).css('display', 'none');
$('#overlay').fadeOut(400);
});
});
$('.btn_register').click( function(e){
e.preventDefault()
var pos = ($(window).scrollTop())+20
$('#login_form').animate({opacity: 0, top: '-50px'}, 200,function(){
$('#register_form')
.css('display', 'block')
.animate({opacity: 1, top: pos}, 200);
});
});
$('#login_form form button').click(function (e) {
if($('#input-1').val().length<1){
e.preventDefault()
$('#input-1').addClass('errors')
} else {
$('#input-1').removeClass('errors')
}
if($('#input-2').val().length<1){
e.preventDefault()
$('#input-2').addClass('errors')
} else {
$('#input-2').removeClass('errors')
}
})
$('#register_form form button').click(function (e) {
if($('#input-3').val().length<1){
e.preventDefault()
$('#input-3').addClass('errors')
} else {
$('#input-3').removeClass('errors')
}
if($('#input-4').val().length<1){
e.preventDefault()
$('#input-4').addClass('errors')
} else {
$('#input-4').removeClass('errors')
}
if($('#input-5').val().length<1){
e.preventDefault()
$('#input-5').addClass('errors')
} else {
$('#input-5').removeClass('errors')
}
})
}
|
30e3d244
Yarik
Forms
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
$(document).on('beforeSubmit', '#personal-form', function(e) {
postForm(this);
return false;
});
$(document).on('beforeSubmit', '#passport-form', function(e) {
postForm(this);
return false;
});
function postForm(context) {
$.post($(context).attr('action'), $(context).serialize(), function(data) {
var type;
if(data.error) {
type = 'danger';
} else {
type = 'success';
}
showStatus(data.message, type);
reload($(context).parents('.pjax_container').attr('id'));
}.bind(this));
}
function showStatus(txt, type) {
$.notify({
message: txt
}, {
type: type
});
}
function reload(id) {
$('#'+id).prepend('<div class="preloader"></div>');
$.pjax.reload('#'+id);
}
|