소스 정리(스크롤 처리 함수)

main
이범준 1 year ago
parent c556da12d1
commit eb33a3e5b2

@ -199,6 +199,17 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -241,16 +252,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").scroll(function(){ $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
var el = $(this);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
});
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -205,6 +205,17 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -248,16 +259,7 @@ $(document).ready(function(){
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").scroll(function(){ $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
var el = $(this);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
});
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -181,6 +181,17 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -231,16 +242,7 @@ $(document).ready(function(){
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$("#btnInsertByFile--${pageName}").on('click', () => { $P.crdnControl.newInfo("file"); }); $("#btnInsertByFile--${pageName}").on('click', () => { $P.crdnControl.newInfo("file"); });
$("#btnInsertByHand--${pageName}").on('click', () => { $P.crdnControl.newInfo("hand"); }); $("#btnInsertByHand--${pageName}").on('click', () => { $P.crdnControl.newInfo("hand"); });
$("#table-responsive--${pageName}").scroll(function(){ $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
var el = $(this);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
});
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -383,6 +383,17 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -425,16 +436,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").scroll(function(){ $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
var el = $(this);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
});
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -468,6 +468,17 @@ $(document).ready(function(){
$P.sameVehicleControl.sub.load(0); $P.sameVehicleControl.sub.load(0);
} }
$P.scrollEnd = (obj) => {
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollInspectionDataList();
}
}
$P.scrollInspectionDataList = () => { $P.scrollInspectionDataList = () => {
switch ($P.currentDisplay) { switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
@ -581,22 +592,11 @@ $(document).ready(function(){
}); });
$('#btnSearch--${pageName}').on('click', () => $P.searchInspectionList()); //검색버튼 $('#btnSearch--${pageName}').on('click', () => $P.searchInspectionList()); //검색버튼
//스크롤 이벤트 추가(사진검사) //스크롤 이벤트 추가(사진검사)
$("#photoInspection-responsive--${pageName}").scroll(function(){ $("#photoInspection-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
var el = $(this); //스크롤 이벤트 추가(동일차량검사)
if(el.scrollTop() == 0){ return; } $("#sameVehicleInspectionMain-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollInspectionDataList();
}
});
//스크롤 이벤트 추가(동일차량검사)
$("#sameVehicleInspectionMain-responsive--${pageName}").scroll(function(){
var el = $(this);
if(el.scrollTop() == 0){ return; }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollInspectionDataList();
}
});
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -170,6 +170,17 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -222,15 +233,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").scroll(function(){ $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
var el = $(this);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
});
$('#btnUpdateToConfirmData--${pageName}').on('click', () => { $('#btnUpdateToConfirmData--${pageName}').on('click', () => {
if(!$P.crdnControl.getCurrent()) { if(!$P.crdnControl.getCurrent()) {

@ -191,6 +191,17 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -235,15 +246,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").scroll(function(){ $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
var el = $(this);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) == el.outerHeight()){
$P.scrollCrdnList();
}
});
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

Loading…
Cancel
Save