드래그 가능한 다이얼로그 생성 함수 추가

main
이범준 9 months ago
parent 3356843acc
commit 8aa5d575e0

@ -280,3 +280,44 @@ function fnMakeSingleImageViewer(imgEl, fileInputEl, dataAttributeForFilePath, d
});
}
/**************************************************************************
* 드래그 가능한 다이얼로그
**************************************************************************/
function fnMakeDraggableDialog(dialogEl) {
var currentPosX = 0, currentPosY = 0, previousPosX = 0, previousPosY = 0;
$(dialogEl).find(".modal-header")[0].onmousedown = fnDragMouseDown;
function fnDragMouseDown(e) {
e.preventDefault();
previousPosX = e.clientX;
previousPosY = e.clientY;
document.onmouseup = fnCloseDragElement;
document.onmousemove = fnElementDrag;
}
function fnElementDrag(e) {
e.preventDefault();
currentPosX = previousPosX - e.clientX;
currentPosY = previousPosY - e.clientY;
previousPosX = e.clientX;
previousPosY = e.clientY;
dialogEl.style.top = (dialogEl.offsetTop - currentPosY) + 'px';
dialogEl.style.left = (dialogEl.offsetLeft - currentPosX) + 'px';
}
function fnCloseDragElement() {
document.onmouseup = null;
document.onmousemove = null;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

@ -1,13 +1,9 @@
/*! jQuery UI - v1.13.2 - 2024-01-26
/*! jQuery UI - v1.13.2 - 2024-02-07
* http://jqueryui.com
* Includes: draggable.css, core.css, resizable.css, theme.css
* Includes: core.css, resizable.css, theme.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=base&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif
* Copyright jQuery Foundation and other contributors; Licensed MIT */
.ui-draggable-handle {
-ms-touch-action: none;
touch-action: none;
}
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {

File diff suppressed because it is too large Load Diff

@ -8,10 +8,6 @@
*
* http://api.jqueryui.com/category/theming/
*/
.ui-draggable-handle {
-ms-touch-action: none;
touch-action: none;
}
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {

Loading…
Cancel
Save