fix : 상품 목록 제거 기능 추가(폐기신청서접수 등록 화면), 그리드 이미지 뷰어 수정
parent
38061cfbed
commit
8ceb9372a7
@ -1,49 +1,48 @@
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* 그리드 내부 이미지 첨부
|
* 그리드 내부 이미지 첨부
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
function fnMakeGridImageViewer(tdEls, fileInputElName){
|
function fnMakeGridImageViewer(tdEl, fileInputElName){
|
||||||
|
|
||||||
for(let tdEl of tdEls){
|
let fileInputEl = document.createElement("input");
|
||||||
|
fileInputEl.name = fileInputElName;
|
||||||
let fileInputEl = document.createElement("input");
|
fileInputEl.type = "file";
|
||||||
fileInputEl.name = fileInputElName;
|
fileInputEl.setAttribute("hidden","hidden");
|
||||||
fileInputEl.type = "file";
|
fileInputEl.setAttribute("accept","image/*")
|
||||||
fileInputEl.setAttribute("hidden","hidden");
|
tdEl.appendChild(fileInputEl);
|
||||||
fileInputEl.setAttribute("accept","image/*")
|
|
||||||
tdEl.appendChild(fileInputEl);
|
let uploadButtonEl = document.createElement("button");
|
||||||
|
uploadButtonEl.type = "button";
|
||||||
let uploadButtonEl = document.createElement("button");
|
uploadButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
||||||
uploadButtonEl.type = "button";
|
uploadButtonEl.textContent = "등록";
|
||||||
uploadButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
tdEl.appendChild(uploadButtonEl);
|
||||||
uploadButtonEl.textContent = "등록";
|
|
||||||
tdEl.appendChild(uploadButtonEl);
|
let viewButtonEl = document.createElement("button");
|
||||||
|
viewButtonEl.type = "button";
|
||||||
let viewButtonEl = document.createElement("button");
|
viewButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
||||||
viewButtonEl.type = "button";
|
viewButtonEl.setAttribute("hidden","hidden");
|
||||||
viewButtonEl.classList.add("btn","btn-primary","w-px-50", "mx-1");
|
viewButtonEl.textContent = "보기";
|
||||||
viewButtonEl.setAttribute("hidden","hidden");
|
tdEl.appendChild(viewButtonEl);
|
||||||
viewButtonEl.textContent = "보기";
|
|
||||||
tdEl.appendChild(viewButtonEl);
|
$(fileInputEl).on("change", function(){
|
||||||
|
if(this.files != null && this.files.length > 0){
|
||||||
$(fileInputEl).on("change", function(){
|
$(uploadButtonEl).text("수정");
|
||||||
if(this.files != null && this.files.length > 0){
|
$(viewButtonEl).removeAttr("hidden");
|
||||||
$(uploadButtonEl).text("수정");
|
} else {
|
||||||
$(viewButtonEl).removeAttr("hidden");
|
$(uploadButtonEl).text("등록");
|
||||||
} else {
|
$(viewButtonEl).attr("hidden","hidden");
|
||||||
$(uploadButtonEl).text("등록");
|
}
|
||||||
$(viewButtonEl).attr("hidden","hidden");
|
});
|
||||||
}
|
|
||||||
});
|
$(uploadButtonEl).on("click", function(){
|
||||||
|
$(fileInputEl).click();
|
||||||
$(uploadButtonEl).on("click", function(){
|
});
|
||||||
$(fileInputEl).click();
|
|
||||||
});
|
$(viewButtonEl).on("click", function(){
|
||||||
|
|
||||||
$(viewButtonEl).on("click", function(){
|
let viewUrl = (window.URL || window.webkitURL).createObjectURL(fileInputEl.files[0]);
|
||||||
window.open((window.URL || window.webkitURL).createObjectURL(fileInputEl.files[0])
|
|
||||||
, "이미지"
|
window.open(viewUrl, "이미지", "width=500, height=500");
|
||||||
, "width=500, height=500");
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue