
PK 
$(document).ready(function(){
$('#checkboxRep').click(function(){
if($(this).hasClass('after')){
$(this).removeClass('after');
$('#password').attr('type', 'password');
if($('#rePassword').length){
$('#rePassword').attr('type', 'password');
}
if($('#newPassword').length){
$('#newPassword').attr('type', 'password');
}
}else{
$(this).addClass('after');
$('#password').attr('type', 'text');
if($('#rePassword').length){
$('#rePassword').attr('type', 'text');
}
if($('#newPassword').length){
$('#newPassword').attr('type', 'text');
}
}
});
});
$(document).on('click','.upload-btn', function(e){
e.preventDefault();
$(this).siblings('input[type=file]').trigger('click');
});
$(document).on('focusin', '.form-item', function(){
if($(this).val() == ''){
$(this).siblings('.movable').addClass('active');
$(this).siblings('.movable').css({
'top' : '-.6rem',
'font-size' : '.7rem',
});
if($(this).hasClass('date')){
$(this).attr('type','date');
}
if($(this).hasClass('time')){
$(this).attr('type','time');
}
}
});
$(document).on('change', '.form-item', function(){
if($(this).val() == ''){
$(this).siblings('.movable').addClass('active');
$(this).siblings('.movable').css({
'top' : '-.6rem',
'font-size' : '.7rem',
});
if($(this).hasClass('date')){
$(this).attr('type','date');
}
if($(this).hasClass('time')){
$(this).attr('type','time');
}
}else{
$(this).siblings('.movable').addClass('active');
$(this).siblings('.movable').css({
'top' : '-.6rem',
'font-size' : '.7rem',
});
}
});
$(document).on('focusout', '.form-item', function(){
if($(this).val() == ''){
$(this).siblings('.movable').removeClass('active');
$(this).siblings('.movable').css({
'top' : '.5rem',
'font-size' : '.95rem',
});
if($(this).hasClass('date')){
$(this).attr('type','text');
}
if($(this).hasClass('time')){
$(this).attr('type','text');
}
}
});
$('.form-item').each(function(){
if(!($(this).val() == '')){
$(this).siblings('.movable').addClass('active');
$(this).siblings('.movable').css({
'top' : '-.6rem',
'font-size' : '.7rem',
});
}
});
// $(document).on('click',function(e){
// //console.log('clicked');
// if($('.content-wrapper').hasClass('sidebar-show')){
// if(!($(e.target).closest('.sidebar-wrapper').length)){
// e.preventDefault();
// $('.menubar-toggler').removeClass('active');
// $('.content-wrapper').removeClass('sidebar-show');
// }
// }else{
// // console.log($(e.target).closest('.menubar-toggler').length);
// if($(e.target).closest('.menubar-toggler').length){
// $('.menubar-toggler').addClass('active');
// $('.content-wrapper').addClass('sidebar-show');
// }
// }
// });
$(document).on('click',function(e){
if($(e.target).closest('.menubar-toggler').length){
$('.menubar-toggler').toggleClass('active');
$('.content-wrapper').toggleClass('sidebar-hide');
}
});
/* $(document).ready(function() {
$('.select2me').select2();
}); */
function del(p){
cn=confirm("Are you sure to delete this record");
if(cn){
window.location.href=p;
}
}


PK 99