$(function(){
let board_code = 'b20220803f1b390b941730';let base_url = '/admin/contents/form/?q=YToxOntzOjQ6ImNvZGUiO3M6MjI6ImIyMDIyMDgwM2YxYjM5MGI5NDE3MzAiO30%3D&pagesize=20&status=all';let input_form_keyword = ``;let params = [board_code, base_url, input_form_keyword];
/**
* 페이지 로드 시 첫번째 페이지(페이징을 통한 1page data)를 로드하고, 더 로드할 데이터의 여부도 같이 전달받습니다.
**/
let getInputFormListResult = adminContents.inputForm.getInputFormList(params);
if(getInputFormListResult.more){
adminContents.inputForm.getInputFormList(params);
}
$('.card').scroll(function(){
let scrollLocation = Math.floor((this.scrollTop / (this.scrollHeight - this.clientHeight)) * 100);
if(getInputFormListResult.more && scrollLocation >= 70) {
adminContents.inputForm.getInputFormList(params);
}
});
const btn = document.querySelector('.btn-select');
const list = document.querySelector('.list-member');
const mobile_card = document.querySelector('.mobile-card');
const body = document.querySelector('body');
let isOpen = false;
$("#mobile-select-box").scroll(function(){
let scrollLocation = Math.floor((list.scrollTop / (list.scrollHeight - list.clientHeight)) * 100);
if(getInputFormListResult.more && scrollLocation >= 70) {
adminContents.inputForm.getInputFormList(params);
}
});
if(btn){
btn.addEventListener('click', () => {
mobile_card.classList.toggle('on');
if(!isOpen){
isOpen = true;
}else{
isOpen = false;
}
});
body.addEventListener('click', (e)=>{
if(isOpen && e.target.className !== 'btn-select'){
mobile_card.classList.toggle('on');
isOpen = false;
}
})
}
});