{"version":3,"sources":["ax5modal.min.js","ax5modal.js","ax5modal-tmpl.js"],"names":["UI","ax5","ui","U","util","MODAL","addClass","className","self","this","cfg","ENM","mousedown","mousemove","mouseup","getMousePosition","e","mouseObj","changedTouches","clientX","clientY","instanceId","getGuid","config","id","position","left","top","margin","minimizePosition","clickEventName","document","documentElement","theme","width","height","closeToEsc","disableDrag","disableResize","animateTime","iframe","activeModal","watingModal","$","onStateChanged","opts","that","eventProcessor","resize","onResize","call","move","state","getContent","modalId","data","header","fullScreen","styles","iframeLoadingMsg","zIndex","absolute","param","tmpl","get","open","callback","jQuery","body","append","root","find","align","css","attr","method","target","action","url","on","hide","bind","show","submit","window","onkeyup","event","off","isButton","findParentNode","_target","getAttribute","isFullScreen","mousePosition","moveModal","btnOnClick","stopEvent","originalEvent","resizeModal","k","srcElement","key","value","btns","dialogId","btnTarget","onClick","keyCode","info","eventKeys","ESC","close","alignProcessor","top-left","top-right","bottom-left","bottom-right","center-middle","modalZIndex","modalOffset","offset","modalBox","outerWidth","outerHeight","windowBox","scrollLeft","scrollTop","getResizerPosition","__dx","__dy","resizerBg","resizer","setModalPosition","box","modalConfig","removeClass","remove","removeAttr","resizerType","resizerProcessor","minHeight","shiftKey","altKey","bottom","minWidth","right","cursorType","cursor","extend","headerHeight","unbind","init","tryCount","setTimeout","_option","$iframe","iframeObject","idoc","contentDocument","contentWindow","children","each","innerHTML","CollectGarbage","isFunction","minimized","minimize","originalHeight","restore","undefined","setModalConfig","_config","_fullScreen","main","modal_instance","push","arguments","isObject","setConfig","apply","modal","content","tmplName","columnKeys","mustache","render"],"mappings":"AAAA,cCOA,WACA,GAAAA,GAAAC,IAAAC,GACAC,EAAAF,IAAAG,KACAC,EAAAA,MAEAL,GAAAM,UAEAC,UAAA,SAEA,WAMA,MAAA,YACA,GAAAC,GAAAC,KACAC,EAAAA,OACAC,GACAC,UAAA,YACAC,UAAA,YACAC,QAAA,WAEAC,EAAA,SAAAC,GACA,GAAAC,GAAAD,CAIA,O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,KAAAtK,MAEAuK,WAAA7K,EAAA8K,SAAAD,UAAA,KACAvK,KAAAyK,UAAAF,UAAA,KAEAG,MAAA1K,KAAAuK,gBAKA3K,EAAAJ,IAAAC,GAAAkL,SCnuCA,WACA,GAAA/K,GAAAJ,IAAAC,GAAAkL,MAEAC,EAAA,WACA,MAAA,uzEA+CAhL,GAAA0D,MACAsH,QAAAA,EAEArH,IAAA,SAAAsH,EAAA/H,EAAAgI,GACA,MAAAtL,KAAAuL,SAAAC,OAAApL,EAAA0D,KAAAuH,GAAApI,KAAAzC,KAAA8K,GAAAhI","file":"ax5modal.min.js","sourcesContent":["\"use strict\";\n\n/*\n * Copyright (c) 2016. tom@axisj.com\n * - github.com/thomasjang\n * - www.axisj.com\n */\n\n// ax5.ui.modal\n(function () {\n var UI = ax5.ui;\n var U = ax5.util;\n var MODAL = void 0;\n\n UI.addClass({\n className: \"modal\"\n }, function () {\n /**\n * @class ax5modal\n * @alias ax5.ui.modal\n * @author tom@axisj.com\n */\n return function () {\n var self = this,\n cfg = void 0,\n ENM = {\n mousedown: \"mousedown\",\n mousemove: \"mousemove\",\n mouseup: \"mouseup\"\n },\n getMousePosition = function getMousePosition(e) {\n var mouseObj = e;\n if (\"changedTouches\" in e && e.changedTouches) {\n mouseObj = e.changedTouches[0];\n }\n return {\n clientX: mouseObj.clientX,\n clientY: mouseObj.clientY\n };\n };\n\n this.instanceId = ax5.getGuid();\n this.config = {\n id: \"ax5-modal-\" + this.instanceId,\n position: {\n left: \"center\",\n top: \"middle\",\n margin: 10\n },\n minimizePosition: \"bottom-right\",\n clickEventName: \"ontouchstart\" in document.documentElement ? \"touchstart\" : \"click\",\n theme: \"default\",\n width: 300,\n height: 400,\n closeToEsc: true,\n disableDrag: false,\n disableResize: false,\n animateTime: 250,\n iframe: false\n };\n this.activeModal = null;\n this.watingModal = false;\n this.$ = {}; // UI inside of the jQuery object store\n\n cfg = this.config; // extended config copy cfg\n\n var onStateChanged = function onStateChanged(opts, that) {\n var eventProcessor = {\n resize: function resize(that) {\n if (opts && opts.onResize) {\n opts.onResize.call(that, that);\n } else if (this.onResize) {\n this.onResize.call(that, that);\n }\n },\n move: function move() {}\n };\n if (that.state in eventProcessor) {\n eventProcessor[that.state].call(this, that);\n }\n\n if (opts && opts.onStateChanged) {\n opts.onStateChanged.call(that, that);\n } else if (this.onStateChanged) {\n this.onStateChanged.call(that, that);\n }\n return true;\n },\n getContent = function getContent(modalId, opts) {\n var data = {\n modalId: modalId,\n theme: opts.theme,\n header: opts.header,\n fullScreen: opts.fullScreen ? \"fullscreen\" : \"\",\n styles: \"\",\n iframe: opts.iframe,\n iframeLoadingMsg: opts.iframeLoadingMsg,\n disableResize: opts.disableResize\n };\n\n if (opts.zIndex) {\n data.styles += \"z-index:\" + opts.zIndex + \";\";\n }\n if (opts.absolute) {\n data.styles += \"position:absolute;\";\n }\n\n if (data.iframe && typeof data.iframe.param === \"string\") {\n data.iframe.param = ax5.util.param(data.iframe.param);\n }\n\n return MODAL.tmpl.get.call(this, \"content\", data, {});\n },\n open = function open(opts, callback) {\n var that = void 0;\n jQuery(document.body).append(getContent.call(this, opts.id, opts));\n\n this.activeModal = jQuery(\"#\" + opts.id);\n // 파트수집\n this.$ = {\n root: this.activeModal,\n header: this.activeModal.find('[data-modal-els=\"header\"]'),\n body: this.activeModal.find('[data-modal-els=\"body\"]')\n };\n\n if (opts.iframe) {\n this.$[\"iframe-wrap\"] = this.activeModal.find('[data-modal-els=\"iframe-wrap\"]');\n this.$[\"iframe\"] = this.activeModal.find('[data-modal-els=\"iframe\"]');\n this.$[\"iframe-form\"] = this.activeModal.find('[data-modal-els=\"iframe-form\"]');\n this.$[\"iframe-loading\"] = this.activeModal.find('[data-modal-els=\"iframe-loading\"]');\n } else {\n this.$[\"body-frame\"] = this.activeModal.find('[data-modal-els=\"body-frame\"]');\n }\n\n //- position 정렬\n this.align();\n\n that = {\n self: this,\n id: opts.id,\n theme: opts.theme,\n width: opts.width,\n height: opts.height,\n state: \"open\",\n $: this.$\n };\n\n if (opts.iframe) {\n this.$[\"iframe-wrap\"].css({ height: opts.height });\n this.$[\"iframe\"].css({ height: opts.height });\n\n // iframe content load\n this.$[\"iframe-form\"].attr({ method: opts.iframe.method });\n this.$[\"iframe-form\"].attr({ target: opts.id + \"-frame\" });\n this.$[\"iframe-form\"].attr({ action: opts.iframe.url });\n this.$[\"iframe\"].on(\"load\", function () {\n that.state = \"load\";\n if (opts.iframeLoadingMsg) {\n this.$[\"iframe-loading\"].hide();\n }\n onStateChanged.call(this, opts, that);\n }.bind(this));\n if (!opts.iframeLoadingMsg) {\n this.$[\"iframe\"].show();\n }\n this.$[\"iframe-form\"].submit();\n }\n\n if (callback) callback.call(that, that);\n\n if (!this.watingModal) {\n onStateChanged.call(this, opts, that);\n }\n\n // bind key event\n if (opts.closeToEsc) {\n jQuery(window).bind(\"keydown.ax-modal\", function (e) {\n onkeyup.call(this, e || window.event);\n }.bind(this));\n }\n\n jQuery(window).bind(\"resize.ax-modal\", function (e) {\n this.align(null, e || window.event);\n }.bind(this));\n\n this.$.header.off(ENM[\"mousedown\"]).off(\"dragstart\").on(ENM[\"mousedown\"], function (e) {\n /// 이벤트 필터링 추가 : 버튼엘리먼트로 부터 발생된 이벤트이면 moveModal 시작하지 않도록 필터링\n var isButton = U.findParentNode(e.target, function (_target) {\n if (_target.getAttribute(\"data-modal-header-btn\")) {\n return true;\n }\n });\n\n if (!opts.isFullScreen && !isButton && opts.disableDrag != true) {\n self.mousePosition = getMousePosition(e);\n moveModal.on.call(self);\n }\n if (isButton) {\n btnOnClick.call(self, e || window.event, opts);\n }\n }).on(\"dragstart\", function (e) {\n U.stopEvent(e.originalEvent);\n return false;\n });\n\n this.activeModal.off(ENM[\"mousedown\"]).off(\"dragstart\").on(ENM[\"mousedown\"], \"[data-ax5modal-resizer]\", function (e) {\n if (opts.disableDrag || opts.isFullScreen) return false;\n self.mousePosition = getMousePosition(e);\n resizeModal.on.call(self, this.getAttribute(\"data-ax5modal-resizer\"));\n }).on(\"dragstart\", function (e) {\n U.stopEvent(e.originalEvent);\n return false;\n });\n },\n btnOnClick = function btnOnClick(e, opts, callback, target, k) {\n var that = void 0;\n if (e.srcElement) e.target = e.srcElement;\n\n target = U.findParentNode(e.target, function (target) {\n if (target.getAttribute(\"data-modal-header-btn\")) {\n return true;\n }\n });\n\n if (target) {\n k = target.getAttribute(\"data-modal-header-btn\");\n\n that = {\n self: this,\n key: k,\n value: opts.header.btns[k],\n dialogId: opts.id,\n btnTarget: target\n };\n\n if (opts.header.btns[k].onClick) {\n opts.header.btns[k].onClick.call(that, k);\n }\n }\n\n that = null;\n opts = null;\n callback = null;\n target = null;\n k = null;\n },\n onkeyup = function onkeyup(e) {\n if (e.keyCode == ax5.info.eventKeys.ESC) {\n this.close();\n }\n },\n alignProcessor = {\n \"top-left\": function topLeft() {\n this.align({ left: \"left\", top: \"top\" });\n },\n \"top-right\": function topRight() {\n this.align({ left: \"right\", top: \"top\" });\n },\n \"bottom-left\": function bottomLeft() {\n this.align({ left: \"left\", top: \"bottom\" });\n },\n \"bottom-right\": function bottomRight() {\n this.align({ left: \"right\", top: \"bottom\" });\n },\n \"center-middle\": function centerMiddle() {\n this.align({ left: \"center\", top: \"middle\" });\n }\n },\n moveModal = {\n on: function on() {\n var modalZIndex = this.activeModal.css(\"z-index\"),\n modalOffset = this.activeModal.offset(),\n modalBox = {\n width: this.activeModal.outerWidth(),\n height: this.activeModal.outerHeight()\n },\n windowBox = {\n width: jQuery(window).width(),\n height: jQuery(window).height(),\n scrollLeft: jQuery(document).scrollLeft(),\n scrollTop: jQuery(document).scrollTop()\n },\n getResizerPosition = function getResizerPosition(e) {\n self.__dx = e.clientX - self.mousePosition.clientX;\n self.__dy = e.clientY - self.mousePosition.clientY;\n\n /*\n if (minX > modalOffset.left + self.__dx) {\n self.__dx = -modalOffset.left;\n } else if (maxX < modalOffset.left + self.__dx) {\n self.__dx = maxX - modalOffset.left;\n }\n if (minY > modalOffset.top + self.__dy) {\n self.__dy = -modalOffset.top;\n } else if (maxY < modalOffset.top + self.__dy) {\n self.__dy = maxY - modalOffset.top;\n }\n */\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dy\n };\n };\n\n var minX = 0,\n maxX = windowBox.width - modalBox.width,\n minY = 0,\n maxY = windowBox.height - modalBox.height;\n\n self.__dx = 0; // 변화량 X\n self.__dy = 0; // 변화량 Y\n\n // self.resizerBg : body 가 window보다 작을 때 문제 해결을 위한 DIV\n self.resizerBg = jQuery('
');\n self.resizer = jQuery('');\n self.resizerBg.css({ zIndex: modalZIndex });\n self.resizer.css({\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width,\n height: modalBox.height,\n zIndex: modalZIndex + 1\n });\n\n jQuery(document.body).append(self.resizerBg).append(self.resizer);\n\n self.activeModal.addClass(\"draged\");\n\n jQuery(document.body).on(ENM[\"mousemove\"] + \".ax5modal-move-\" + this.instanceId, function (e) {\n self.resizer.css(getResizerPosition(e));\n }).on(ENM[\"mouseup\"] + \".ax5modal-move-\" + this.instanceId, function (e) {\n moveModal.off.call(self);\n }).on(\"mouseleave.ax5modal-move-\" + this.instanceId, function (e) {\n moveModal.off.call(self);\n });\n\n jQuery(document.body).attr(\"unselectable\", \"on\").css(\"user-select\", \"none\").on(\"selectstart\", false);\n },\n off: function off() {\n var setModalPosition = function setModalPosition() {\n var box = this.resizer.offset();\n if (!this.modalConfig.absolute) {\n box.left -= jQuery(document).scrollLeft();\n box.top -= jQuery(document).scrollTop();\n }\n this.activeModal.css(box);\n this.modalConfig.left = box.left;\n this.modalConfig.top = box.top;\n\n box = null;\n };\n\n this.activeModal.removeClass(\"draged\");\n setModalPosition.call(this);\n\n this.resizer.remove();\n this.resizer = null;\n this.resizerBg.remove();\n this.resizerBg = null;\n //this.align();\n\n jQuery(document.body).off(ENM[\"mousemove\"] + \".ax5modal-move-\" + this.instanceId).off(ENM[\"mouseup\"] + \".ax5modal-move-\" + this.instanceId).off(\"mouseleave.ax5modal-move-\" + this.instanceId);\n\n jQuery(document.body).removeAttr(\"unselectable\").css(\"user-select\", \"auto\").off(\"selectstart\");\n\n onStateChanged.call(this, self.modalConfig, {\n self: this,\n state: \"move\"\n });\n }\n },\n resizeModal = {\n on: function on(resizerType) {\n var modalZIndex = this.activeModal.css(\"z-index\"),\n modalOffset = this.activeModal.offset(),\n modalBox = {\n width: this.activeModal.outerWidth(),\n height: this.activeModal.outerHeight()\n },\n windowBox = {\n width: jQuery(window).width(),\n height: jQuery(window).height(),\n scrollLeft: jQuery(document).scrollLeft(),\n scrollTop: jQuery(document).scrollTop()\n },\n resizerProcessor = {\n top: function top(e) {\n if (minHeight > modalBox.height - self.__dy) {\n self.__dy = modalBox.height - minHeight;\n }\n\n if (e.shiftKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n\n return {\n left: modalOffset.left,\n top: modalOffset.top + self.__dy,\n width: modalBox.width,\n height: modalBox.height - self.__dy * 2\n };\n } else if (e.altKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dy,\n top: modalOffset.top + self.__dy,\n width: modalBox.width - self.__dy * 2,\n height: modalBox.height - self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top + self.__dy,\n width: modalBox.width,\n height: modalBox.height - self.__dy\n };\n }\n },\n bottom: function bottom(e) {\n if (minHeight > modalBox.height + self.__dy) {\n self.__dy = -modalBox.height + minHeight;\n }\n\n if (e.shiftKey) {\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n\n return {\n left: modalOffset.left,\n top: modalOffset.top - self.__dy,\n width: modalBox.width,\n height: modalBox.height + self.__dy * 2\n };\n } else if (e.altKey) {\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dy,\n top: modalOffset.top - self.__dy,\n width: modalBox.width + self.__dy * 2,\n height: modalBox.height + self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width,\n height: modalBox.height + self.__dy\n };\n }\n },\n left: function left(e) {\n if (minWidth > modalBox.width - self.__dx) {\n self.__dx = modalBox.width - minWidth;\n }\n\n if (e.shiftKey) {\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height\n };\n } else if (e.altKey) {\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dx,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height - self.__dx * 2\n };\n } else {\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top,\n width: modalBox.width - self.__dx,\n height: modalBox.height\n };\n }\n },\n right: function right(e) {\n if (minWidth > modalBox.width + self.__dx) {\n self.__dx = -modalBox.width + minWidth;\n }\n\n if (e.shiftKey) {\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height\n };\n } else if (e.altKey) {\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top - self.__dx,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height + self.__dx * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width + self.__dx,\n height: modalBox.height\n };\n }\n },\n \"top-left\": function topLeft(e) {\n if (minWidth > modalBox.width - self.__dx) {\n self.__dx = modalBox.width - minWidth;\n }\n\n if (minHeight > modalBox.height - self.__dy) {\n self.__dy = modalBox.height - minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dy,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height - self.__dy * 2\n };\n } else {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dy,\n width: modalBox.width - self.__dx,\n height: modalBox.height - self.__dy\n };\n }\n },\n \"top-right\": function topRight(e) {\n if (minWidth > modalBox.width + self.__dx) {\n self.__dx = -modalBox.width + minWidth;\n }\n\n if (minHeight > modalBox.height - self.__dy) {\n self.__dy = modalBox.height - minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top + self.__dy,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height - self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top + self.__dy,\n width: modalBox.width + self.__dx,\n height: modalBox.height - self.__dy\n };\n }\n },\n \"bottom-left\": function bottomLeft(e) {\n if (minWidth > modalBox.width - self.__dx) {\n self.__dx = modalBox.width - minWidth;\n }\n\n if (minHeight > modalBox.height + self.__dy) {\n self.__dy = -modalBox.height + minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top - self.__dy,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height + self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top,\n width: modalBox.width - self.__dx,\n height: modalBox.height + self.__dy\n };\n }\n },\n \"bottom-right\": function bottomRight(e) {\n if (minWidth > modalBox.width + self.__dx) {\n self.__dx = -modalBox.width + minWidth;\n }\n\n if (minHeight > modalBox.height + self.__dy) {\n self.__dy = -modalBox.height + minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top - self.__dy,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height + self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width + self.__dx,\n height: modalBox.height + self.__dy\n };\n }\n }\n },\n getResizerPosition = function getResizerPosition(e) {\n self.__dx = e.clientX - self.mousePosition.clientX;\n self.__dy = e.clientY - self.mousePosition.clientY;\n\n return resizerProcessor[resizerType](e);\n };\n\n var minWidth = 100,\n minHeight = 100;\n\n var cursorType = {\n top: \"row-resize\",\n bottom: \"row-resize\",\n left: \"col-resize\",\n right: \"col-resize\",\n \"top-left\": \"nwse-resize\",\n \"top-right\": \"nesw-resize\",\n \"bottom-left\": \"nesw-resize\",\n \"bottom-right\": \"nwse-resize\"\n };\n\n self.__dx = 0; // 변화량 X\n self.__dy = 0; // 변화량 Y\n\n // self.resizerBg : body 가 window보다 작을 때 문제 해결을 위한 DIV\n self.resizerBg = jQuery('');\n self.resizer = jQuery('');\n self.resizerBg.css({\n zIndex: modalZIndex,\n cursor: cursorType[resizerType]\n });\n self.resizer.css({\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width,\n height: modalBox.height,\n zIndex: modalZIndex + 1,\n cursor: cursorType[resizerType]\n });\n jQuery(document.body).append(self.resizerBg).append(self.resizer);\n self.activeModal.addClass(\"draged\");\n\n jQuery(document.body).bind(ENM[\"mousemove\"] + \".ax5modal-resize-\" + this.instanceId, function (e) {\n self.resizer.css(getResizerPosition(e));\n }).bind(ENM[\"mouseup\"] + \".ax5modal-resize-\" + this.instanceId, function (e) {\n resizeModal.off.call(self);\n }).bind(\"mouseleave.ax5modal-resize-\" + this.instanceId, function (e) {\n resizeModal.off.call(self);\n });\n\n jQuery(document.body).attr(\"unselectable\", \"on\").css(\"user-select\", \"none\").bind(\"selectstart\", false);\n },\n off: function off() {\n var setModalPosition = function setModalPosition() {\n var box = this.resizer.offset();\n jQuery.extend(box, {\n width: this.resizer.width(),\n height: this.resizer.height()\n });\n if (!this.modalConfig.absolute) {\n box.left -= jQuery(document).scrollLeft();\n box.top -= jQuery(document).scrollTop();\n }\n this.activeModal.css(box);\n\n this.modalConfig.left = box.left;\n this.modalConfig.top = box.top;\n this.modalConfig.width = box.width;\n this.modalConfig.height = box.height;\n this.$[\"body\"].css({\n height: box.height - this.modalConfig.headerHeight\n });\n if (this.modalConfig.iframe) {\n this.$[\"iframe-wrap\"].css({\n height: box.height - this.modalConfig.headerHeight\n });\n this.$[\"iframe\"].css({\n height: box.height - this.modalConfig.headerHeight\n });\n }\n\n box = null;\n };\n\n this.activeModal.removeClass(\"draged\");\n setModalPosition.call(this);\n\n this.resizer.remove();\n this.resizer = null;\n this.resizerBg.remove();\n this.resizerBg = null;\n\n onStateChanged.call(this, self.modalConfig, {\n self: this,\n state: \"resize\"\n });\n\n jQuery(document.body).unbind(ENM[\"mousemove\"] + \".ax5modal-resize-\" + this.instanceId).unbind(ENM[\"mouseup\"] + \".ax5modal-resize-\" + this.instanceId).unbind(\"mouseleave.ax5modal-resize-\" + this.instanceId);\n\n jQuery(document.body).removeAttr(\"unselectable\").css(\"user-select\", \"auto\").unbind(\"selectstart\");\n }\n };\n\n /// private end\n\n /**\n * Preferences of modal UI\n * @method ax5modal.setConfig\n * @param {Object} config - 클래스 속성값\n * @param {Number} [config.zIndex]\n * @param {Object} [config.position]\n * @param {String} [config.position.left=\"center\"]\n * @param {String} [config.position.top=\"middle\"]\n * @param {Number} [config.position.margin=10]\n * @param {String} [config.minimizePosition=\"bottom-right\"]\n * @param {Number} [config.width=300]\n * @param {Number} [config.height=400]\n * @param {Boolean} [config.closeToEsc=true]\n * @param {Boolean} [config.absolute=false]\n * @param {Boolean} [config.disableDrag=false]\n * @param {Boolean} [config.disableResize=false]\n * @param {Number} [config.animateTime=250]\n * @param {Function} [config.fullScreen]\n * @param {Function} [config.onStateChanged] - `onStateChanged` function can be defined in setConfig method or new ax5.ui.modal initialization method. However, you can us to define an event function after initialization, if necessary\n * @param {Function} [config.onResize]\n * @returns {ax5modal}\n * @example\n * ```js\n * var modal = new ax5.ui.modal({\n * iframeLoadingMsg: '',\n * header: {\n * title: \"MODAL TITLE\",\n * btns: {\n * minimize: {\n * label: '', onClick: function () {\n * modal.minimize();\n * }\n * },\n * maximize: {\n * label: '', onClick: function () {\n * modal.maximize();\n * }\n * },\n * close: {\n * label: '', onClick: function () {\n * modal.close();\n * }\n * }\n * }\n * }\n * });\n *\n * modal.open({\n * width: 800,\n * height: 600,\n * fullScreen: function(){\n * return ($(window).width() < 600);\n * },\n * iframe: {\n * method: \"get\",\n * url: \"http://chequer-app:2017/html/login.html\",\n * param: \"callback=modalCallback\"\n * },\n * onStateChanged: function(){\n * console.log(this);\n * },\n * onResize: function(){\n * console.log(this);\n * }\n * });\n * ```\n */\n //== class body start\n this.init = function () {\n this.onStateChanged = cfg.onStateChanged;\n this.onResize = cfg.onResize;\n };\n\n /**\n * open the modal\n * @method ax5modal.open\n * @returns {ax5modal}\n * @example\n * ```\n * modal.open();\n * modal.open({\n * width: 500,\n * height: 500\n * });\n * moaal.open({}, function(){\n * console.log(this);\n * });\n * ```\n */\n this.open = function (opts, callback, tryCount) {\n if (typeof tryCount === \"undefined\") tryCount = 0;\n if (!this.activeModal) {\n opts = self.modalConfig = jQuery.extend(true, {}, cfg, opts);\n open.call(this, opts, callback);\n this.watingModal = false;\n } else if (tryCount < 3) {\n // 3번까지 재 시도\n this.watingModal = true;\n setTimeout(function () {\n this.open(opts, callback, tryCount + 1);\n }.bind(this), cfg.animateTime);\n } else {\n // 열기 시도 종료\n this.watingModal = false;\n }\n return this;\n };\n\n /**\n * close the modal\n * @method ax5modal.close\n * @param _option\n * @returns {ax5modal}\n * @example\n * ```\n * my_modal.close();\n * my_modal.close({callback: function(){\n * // on close event\n * });\n * // close 함수에 callback을 전달하면 정확한 close 타이밍을 캐치할 수 있습니다\n * ```\n */\n\n this.close = function (_option) {\n var opts = void 0,\n that = void 0;\n\n if (this.activeModal) {\n opts = self.modalConfig;\n this.activeModal.addClass(\"destroy\");\n jQuery(window).unbind(\"keydown.ax-modal\");\n jQuery(window).unbind(\"resize.ax-modal\");\n\n setTimeout(function () {\n // 프레임 제거\n if (opts.iframe) {\n var $iframe = this.$[\"iframe\"]; // iframe jQuery Object\n if ($iframe) {\n var iframeObject = $iframe.get(0),\n idoc = iframeObject.contentDocument ? iframeObject.contentDocument : iframeObject.contentWindow.document;\n\n try {\n $(idoc.body).children().each(function () {\n $(this).remove();\n });\n } catch (e) {}\n idoc.innerHTML = \"\";\n $iframe.attr(\"src\", \"about:blank\").remove();\n\n // force garbarge collection for IE only\n window.CollectGarbage && window.CollectGarbage();\n }\n }\n\n this.activeModal.remove();\n this.activeModal = null;\n\n // 모달 오픈 대기중이면 닫기 상태 전달 안함.\n if (!this.watingModal) {\n onStateChanged.call(this, opts, {\n self: this,\n state: \"close\"\n });\n }\n\n if (_option && U.isFunction(_option.callback)) {\n that = {\n self: this,\n id: opts.id,\n theme: opts.theme,\n width: opts.width,\n height: opts.height,\n state: \"close\",\n $: this.$\n };\n _option.callback.call(that, that);\n }\n }.bind(this), cfg.animateTime);\n }\n\n this.minimized = false; // hoksi\n\n return this;\n };\n\n /**\n * @method ax5modal.minimize\n * @returns {ax5modal}\n */\n this.minimize = function () {\n return function (minimizePosition) {\n if (this.minimized !== true) {\n var opts = self.modalConfig;\n if (typeof minimizePosition === \"undefined\") minimizePosition = cfg.minimizePosition;\n\n this.minimized = true;\n this.$.body.hide();\n self.modalConfig.originalHeight = opts.height;\n self.modalConfig.height = 0;\n alignProcessor[minimizePosition].call(this);\n\n onStateChanged.call(this, opts, {\n self: this,\n state: \"minimize\"\n });\n }\n\n return this;\n };\n }();\n\n /**\n * @method ax5modal.restore\n * @returns {ax5modal}\n */\n this.restore = function () {\n var opts = self.modalConfig;\n if (this.minimized) {\n this.minimized = false;\n this.$.body.show();\n self.modalConfig.height = self.modalConfig.originalHeight;\n self.modalConfig.originalHeight = undefined;\n\n this.align({ left: \"center\", top: \"middle\" });\n onStateChanged.call(this, opts, {\n self: this,\n state: \"restore\"\n });\n }\n return this;\n };\n\n /**\n * setCSS\n * @method ax5modal.css\n * @param {Object} css -\n * @returns {ax5modal}\n */\n this.css = function (css) {\n if (this.activeModal && !self.fullScreen) {\n this.activeModal.css(css);\n if (typeof css.width !== \"undefined\") {\n self.modalConfig.width = css.width;\n }\n if (typeof css.height !== \"undefined\") {\n self.modalConfig.height = css.height;\n }\n\n this.align();\n }\n return this;\n };\n\n /**\n * @method ax5modal.setModalConfig\n * @param _config\n * @returns {ax5.ui.ax5modal}\n */\n this.setModalConfig = function (_config) {\n self.modalConfig = jQuery.extend({}, self.modalConfig, _config);\n this.align();\n return this;\n };\n\n /**\n * @method ax5modal.align\n * @param position\n * @param e\n * @returns {ax5modal}\n * @example\n * ```js\n * modal.align({left:\"center\", top:\"middle\"});\n * modal.align({left:\"left\", top:\"top\", margin: 20});\n * ```\n */\n this.align = function () {\n return function (position, e) {\n if (!this.activeModal) return this;\n\n var opts = self.modalConfig,\n box = {\n width: opts.width,\n height: opts.height\n };\n\n var fullScreen = opts.isFullScreen = function (_fullScreen) {\n if (typeof _fullScreen === \"undefined\") {\n return false;\n } else if (U.isFunction(_fullScreen)) {\n return _fullScreen();\n }\n }(opts.fullScreen);\n\n if (fullScreen) {\n if (opts.header) this.$.header.show();\n if (opts.header) {\n opts.headerHeight = this.$.header.outerHeight();\n box.height += opts.headerHeight;\n } else {\n opts.headerHeight = 0;\n }\n box.width = jQuery(window).width();\n box.height = opts.height;\n box.left = 0;\n box.top = 0;\n } else {\n if (opts.header) this.$.header.show();\n if (position) {\n jQuery.extend(true, opts.position, position);\n }\n\n if (opts.header) {\n opts.headerHeight = this.$.header.outerHeight();\n box.height += opts.headerHeight;\n } else {\n opts.headerHeight = 0;\n }\n\n //- position 정렬\n if (opts.position.left == \"left\") {\n box.left = opts.position.margin || 0;\n } else if (opts.position.left == \"right\") {\n // window.innerWidth;\n box.left = jQuery(window).width() - box.width - (opts.position.margin || 0);\n } else if (opts.position.left == \"center\") {\n box.left = jQuery(window).width() / 2 - box.width / 2;\n } else {\n box.left = opts.position.left || 0;\n }\n\n if (opts.position.top == \"top\") {\n box.top = opts.position.margin || 0;\n } else if (opts.position.top == \"bottom\") {\n box.top = jQuery(window).height() - box.height - (opts.position.margin || 0);\n } else if (opts.position.top == \"middle\") {\n box.top = jQuery(window).height() / 2 - box.height / 2;\n } else {\n box.top = opts.position.top || 0;\n }\n if (box.left < 0) box.left = 0;\n if (box.top < 0) box.top = 0;\n\n if (opts.absolute) {\n box.top += jQuery(window).scrollTop();\n box.left += jQuery(window).scrollLeft();\n }\n }\n\n this.activeModal.css(box);\n\n this.$[\"body\"].css({\n height: box.height - (opts.headerHeight || 0)\n });\n\n if (opts.iframe) {\n this.$[\"iframe-wrap\"].css({\n height: box.height - opts.headerHeight\n });\n this.$[\"iframe\"].css({ height: box.height - opts.headerHeight });\n } else {}\n return this;\n };\n }();\n\n // 클래스 생성자\n this.main = function () {\n UI.modal_instance = UI.modal_instance || [];\n UI.modal_instance.push(this);\n\n if (arguments && U.isObject(arguments[0])) {\n this.setConfig(arguments[0]);\n }\n }.apply(this, arguments);\n };\n }());\n\n MODAL = ax5.ui.modal;\n})();\n\n// ax5.ui.modal.tmpl\n(function () {\n var MODAL = ax5.ui.modal;\n\n var content = function content() {\n return \" \\n \\n {{#header}}\\n \\n {{/header}}\\n
\\n {{#iframe}}\\n
\\n
\\n {{/iframe}}\\n {{^iframe}}\\n
\\n {{/iframe}}\\n
\\n {{^disableResize}}\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n {{/disableResize}}\\n
\\n \";\n };\n\n MODAL.tmpl = {\n \"content\": content,\n\n get: function get(tmplName, data, columnKeys) {\n return ax5.mustache.render(MODAL.tmpl[tmplName].call(this, columnKeys), data);\n }\n };\n})();","/*\n * Copyright (c) 2016. tom@axisj.com\n * - github.com/thomasjang\n * - www.axisj.com\n */\n\n// ax5.ui.modal\n(function() {\n const UI = ax5.ui;\n const U = ax5.util;\n let MODAL;\n\n UI.addClass(\n {\n className: \"modal\"\n },\n (function() {\n /**\n * @class ax5modal\n * @alias ax5.ui.modal\n * @author tom@axisj.com\n */\n return function() {\n let self = this,\n cfg,\n ENM = {\n mousedown: \"mousedown\",\n mousemove: \"mousemove\",\n mouseup: \"mouseup\"\n },\n getMousePosition = function(e) {\n let mouseObj = e;\n if (\"changedTouches\" in e && e.changedTouches) {\n mouseObj = e.changedTouches[0];\n }\n return {\n clientX: mouseObj.clientX,\n clientY: mouseObj.clientY\n };\n };\n\n this.instanceId = ax5.getGuid();\n this.config = {\n id: \"ax5-modal-\" + this.instanceId,\n position: {\n left: \"center\",\n top: \"middle\",\n margin: 10\n },\n minimizePosition: \"bottom-right\",\n clickEventName:\n \"ontouchstart\" in document.documentElement ? \"touchstart\" : \"click\",\n theme: \"default\",\n width: 300,\n height: 400,\n closeToEsc: true,\n disableDrag: false,\n disableResize: false,\n animateTime: 250,\n iframe: false\n };\n this.activeModal = null;\n this.watingModal = false;\n this.$ = {}; // UI inside of the jQuery object store\n\n cfg = this.config; // extended config copy cfg\n\n let onStateChanged = function(opts, that) {\n var eventProcessor = {\n resize: function(that) {\n if (opts && opts.onResize) {\n opts.onResize.call(that, that);\n } else if (this.onResize) {\n this.onResize.call(that, that);\n }\n },\n move: function() {}\n };\n if (that.state in eventProcessor) {\n eventProcessor[that.state].call(this, that);\n }\n\n if (opts && opts.onStateChanged) {\n opts.onStateChanged.call(that, that);\n } else if (this.onStateChanged) {\n this.onStateChanged.call(that, that);\n }\n return true;\n },\n getContent = function(modalId, opts) {\n let data = {\n modalId: modalId,\n theme: opts.theme,\n header: opts.header,\n fullScreen: opts.fullScreen ? \"fullscreen\" : \"\",\n styles: \"\",\n iframe: opts.iframe,\n iframeLoadingMsg: opts.iframeLoadingMsg,\n disableResize: opts.disableResize\n };\n\n if (opts.zIndex) {\n data.styles += \"z-index:\" + opts.zIndex + \";\";\n }\n if (opts.absolute) {\n data.styles += \"position:absolute;\";\n }\n\n if (data.iframe && typeof data.iframe.param === \"string\") {\n data.iframe.param = ax5.util.param(data.iframe.param);\n }\n\n return MODAL.tmpl.get.call(this, \"content\", data, {});\n },\n open = function(opts, callback) {\n let that;\n jQuery(document.body).append(getContent.call(this, opts.id, opts));\n\n this.activeModal = jQuery(\"#\" + opts.id);\n // 파트수집\n this.$ = {\n root: this.activeModal,\n header: this.activeModal.find('[data-modal-els=\"header\"]'),\n body: this.activeModal.find('[data-modal-els=\"body\"]')\n };\n\n if (opts.iframe) {\n this.$[\"iframe-wrap\"] = this.activeModal.find(\n '[data-modal-els=\"iframe-wrap\"]'\n );\n this.$[\"iframe\"] = this.activeModal.find(\n '[data-modal-els=\"iframe\"]'\n );\n this.$[\"iframe-form\"] = this.activeModal.find(\n '[data-modal-els=\"iframe-form\"]'\n );\n this.$[\"iframe-loading\"] = this.activeModal.find(\n '[data-modal-els=\"iframe-loading\"]'\n );\n } else {\n this.$[\"body-frame\"] = this.activeModal.find(\n '[data-modal-els=\"body-frame\"]'\n );\n }\n\n //- position 정렬\n this.align();\n\n that = {\n self: this,\n id: opts.id,\n theme: opts.theme,\n width: opts.width,\n height: opts.height,\n state: \"open\",\n $: this.$\n };\n\n if (opts.iframe) {\n this.$[\"iframe-wrap\"].css({ height: opts.height });\n this.$[\"iframe\"].css({ height: opts.height });\n\n // iframe content load\n this.$[\"iframe-form\"].attr({ method: opts.iframe.method });\n this.$[\"iframe-form\"].attr({ target: opts.id + \"-frame\" });\n this.$[\"iframe-form\"].attr({ action: opts.iframe.url });\n this.$[\"iframe\"].on(\n \"load\",\n function() {\n that.state = \"load\";\n if (opts.iframeLoadingMsg) {\n this.$[\"iframe-loading\"].hide();\n }\n onStateChanged.call(this, opts, that);\n }.bind(this)\n );\n if (!opts.iframeLoadingMsg) {\n this.$[\"iframe\"].show();\n }\n this.$[\"iframe-form\"].submit();\n }\n\n if (callback) callback.call(that, that);\n\n if (!this.watingModal) {\n onStateChanged.call(this, opts, that);\n }\n\n // bind key event\n if (opts.closeToEsc) {\n jQuery(window).bind(\n \"keydown.ax-modal\",\n function(e) {\n onkeyup.call(this, e || window.event);\n }.bind(this)\n );\n }\n\n jQuery(window).bind(\n \"resize.ax-modal\",\n function(e) {\n this.align(null, e || window.event);\n }.bind(this)\n );\n\n this.$.header\n .off(ENM[\"mousedown\"])\n .off(\"dragstart\")\n .on(ENM[\"mousedown\"], function(e) {\n /// 이벤트 필터링 추가 : 버튼엘리먼트로 부터 발생된 이벤트이면 moveModal 시작하지 않도록 필터링\n let isButton = U.findParentNode(e.target, function(_target) {\n if (_target.getAttribute(\"data-modal-header-btn\")) {\n return true;\n }\n });\n\n if (\n !opts.isFullScreen &&\n !isButton &&\n opts.disableDrag != true\n ) {\n self.mousePosition = getMousePosition(e);\n moveModal.on.call(self);\n }\n if (isButton) {\n btnOnClick.call(self, e || window.event, opts);\n }\n })\n .on(\"dragstart\", function(e) {\n U.stopEvent(e.originalEvent);\n return false;\n });\n\n this.activeModal\n .off(ENM[\"mousedown\"])\n .off(\"dragstart\")\n .on(ENM[\"mousedown\"], \"[data-ax5modal-resizer]\", function(e) {\n if (opts.disableDrag || opts.isFullScreen) return false;\n self.mousePosition = getMousePosition(e);\n resizeModal.on.call(\n self,\n this.getAttribute(\"data-ax5modal-resizer\")\n );\n })\n .on(\"dragstart\", function(e) {\n U.stopEvent(e.originalEvent);\n return false;\n });\n },\n btnOnClick = function(e, opts, callback, target, k) {\n let that;\n if (e.srcElement) e.target = e.srcElement;\n\n target = U.findParentNode(e.target, function(target) {\n if (target.getAttribute(\"data-modal-header-btn\")) {\n return true;\n }\n });\n\n if (target) {\n k = target.getAttribute(\"data-modal-header-btn\");\n\n that = {\n self: this,\n key: k,\n value: opts.header.btns[k],\n dialogId: opts.id,\n btnTarget: target\n };\n\n if (opts.header.btns[k].onClick) {\n opts.header.btns[k].onClick.call(that, k);\n }\n }\n\n that = null;\n opts = null;\n callback = null;\n target = null;\n k = null;\n },\n onkeyup = function(e) {\n if (e.keyCode == ax5.info.eventKeys.ESC) {\n this.close();\n }\n },\n alignProcessor = {\n \"top-left\": function() {\n this.align({ left: \"left\", top: \"top\" });\n },\n \"top-right\": function() {\n this.align({ left: \"right\", top: \"top\" });\n },\n \"bottom-left\": function() {\n this.align({ left: \"left\", top: \"bottom\" });\n },\n \"bottom-right\": function() {\n this.align({ left: \"right\", top: \"bottom\" });\n },\n \"center-middle\": function() {\n this.align({ left: \"center\", top: \"middle\" });\n }\n },\n moveModal = {\n on: function() {\n let modalZIndex = this.activeModal.css(\"z-index\"),\n modalOffset = this.activeModal.offset(),\n modalBox = {\n width: this.activeModal.outerWidth(),\n height: this.activeModal.outerHeight()\n },\n windowBox = {\n width: jQuery(window).width(),\n height: jQuery(window).height(),\n scrollLeft: jQuery(document).scrollLeft(),\n scrollTop: jQuery(document).scrollTop()\n },\n getResizerPosition = function(e) {\n self.__dx = e.clientX - self.mousePosition.clientX;\n self.__dy = e.clientY - self.mousePosition.clientY;\n\n /*\n if (minX > modalOffset.left + self.__dx) {\n self.__dx = -modalOffset.left;\n } else if (maxX < modalOffset.left + self.__dx) {\n self.__dx = maxX - modalOffset.left;\n }\n\n if (minY > modalOffset.top + self.__dy) {\n self.__dy = -modalOffset.top;\n } else if (maxY < modalOffset.top + self.__dy) {\n self.__dy = maxY - modalOffset.top;\n }\n */\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dy\n };\n };\n\n let minX = 0,\n maxX = windowBox.width - modalBox.width,\n minY = 0,\n maxY = windowBox.height - modalBox.height;\n\n self.__dx = 0; // 변화량 X\n self.__dy = 0; // 변화량 Y\n\n // self.resizerBg : body 가 window보다 작을 때 문제 해결을 위한 DIV\n self.resizerBg = jQuery(\n ''\n );\n self.resizer = jQuery(\n ''\n );\n self.resizerBg.css({ zIndex: modalZIndex });\n self.resizer.css({\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width,\n height: modalBox.height,\n zIndex: modalZIndex + 1\n });\n\n jQuery(document.body)\n .append(self.resizerBg)\n .append(self.resizer);\n\n self.activeModal.addClass(\"draged\");\n\n jQuery(document.body)\n .on(\n ENM[\"mousemove\"] + \".ax5modal-move-\" + this.instanceId,\n function(e) {\n self.resizer.css(getResizerPosition(e));\n }\n )\n .on(\n ENM[\"mouseup\"] + \".ax5modal-move-\" + this.instanceId,\n function(e) {\n moveModal.off.call(self);\n }\n )\n .on(\"mouseleave.ax5modal-move-\" + this.instanceId, function(e) {\n moveModal.off.call(self);\n });\n\n jQuery(document.body)\n .attr(\"unselectable\", \"on\")\n .css(\"user-select\", \"none\")\n .on(\"selectstart\", false);\n },\n off: function() {\n let setModalPosition = function() {\n let box = this.resizer.offset();\n if (!this.modalConfig.absolute) {\n box.left -= jQuery(document).scrollLeft();\n box.top -= jQuery(document).scrollTop();\n }\n this.activeModal.css(box);\n this.modalConfig.left = box.left;\n this.modalConfig.top = box.top;\n\n box = null;\n };\n\n this.activeModal.removeClass(\"draged\");\n setModalPosition.call(this);\n\n this.resizer.remove();\n this.resizer = null;\n this.resizerBg.remove();\n this.resizerBg = null;\n //this.align();\n\n jQuery(document.body)\n .off(ENM[\"mousemove\"] + \".ax5modal-move-\" + this.instanceId)\n .off(ENM[\"mouseup\"] + \".ax5modal-move-\" + this.instanceId)\n .off(\"mouseleave.ax5modal-move-\" + this.instanceId);\n\n jQuery(document.body)\n .removeAttr(\"unselectable\")\n .css(\"user-select\", \"auto\")\n .off(\"selectstart\");\n\n onStateChanged.call(this, self.modalConfig, {\n self: this,\n state: \"move\"\n });\n }\n },\n resizeModal = {\n on: function(resizerType) {\n let modalZIndex = this.activeModal.css(\"z-index\"),\n modalOffset = this.activeModal.offset(),\n modalBox = {\n width: this.activeModal.outerWidth(),\n height: this.activeModal.outerHeight()\n },\n windowBox = {\n width: jQuery(window).width(),\n height: jQuery(window).height(),\n scrollLeft: jQuery(document).scrollLeft(),\n scrollTop: jQuery(document).scrollTop()\n },\n resizerProcessor = {\n top: function(e) {\n if (minHeight > modalBox.height - self.__dy) {\n self.__dy = modalBox.height - minHeight;\n }\n\n if (e.shiftKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n\n return {\n left: modalOffset.left,\n top: modalOffset.top + self.__dy,\n width: modalBox.width,\n height: modalBox.height - self.__dy * 2\n };\n } else if (e.altKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dy,\n top: modalOffset.top + self.__dy,\n width: modalBox.width - self.__dy * 2,\n height: modalBox.height - self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top + self.__dy,\n width: modalBox.width,\n height: modalBox.height - self.__dy\n };\n }\n },\n bottom: function(e) {\n if (minHeight > modalBox.height + self.__dy) {\n self.__dy = -modalBox.height + minHeight;\n }\n\n if (e.shiftKey) {\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n\n return {\n left: modalOffset.left,\n top: modalOffset.top - self.__dy,\n width: modalBox.width,\n height: modalBox.height + self.__dy * 2\n };\n } else if (e.altKey) {\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dy,\n top: modalOffset.top - self.__dy,\n width: modalBox.width + self.__dy * 2,\n height: modalBox.height + self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width,\n height: modalBox.height + self.__dy\n };\n }\n },\n left: function(e) {\n if (minWidth > modalBox.width - self.__dx) {\n self.__dx = modalBox.width - minWidth;\n }\n\n if (e.shiftKey) {\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height\n };\n } else if (e.altKey) {\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dx,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height - self.__dx * 2\n };\n } else {\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top,\n width: modalBox.width - self.__dx,\n height: modalBox.height\n };\n }\n },\n right: function(e) {\n if (minWidth > modalBox.width + self.__dx) {\n self.__dx = -modalBox.width + minWidth;\n }\n\n if (e.shiftKey) {\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height\n };\n } else if (e.altKey) {\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top - self.__dx,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height + self.__dx * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width + self.__dx,\n height: modalBox.height\n };\n }\n },\n \"top-left\": function(e) {\n if (minWidth > modalBox.width - self.__dx) {\n self.__dx = modalBox.width - minWidth;\n }\n\n if (minHeight > modalBox.height - self.__dy) {\n self.__dy = modalBox.height - minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dy,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height - self.__dy * 2\n };\n } else {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top + self.__dy,\n width: modalBox.width - self.__dx,\n height: modalBox.height - self.__dy\n };\n }\n },\n \"top-right\": function(e) {\n if (minWidth > modalBox.width + self.__dx) {\n self.__dx = -modalBox.width + minWidth;\n }\n\n if (minHeight > modalBox.height - self.__dy) {\n self.__dy = modalBox.height - minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minHeight > modalBox.height - self.__dy * 2) {\n self.__dy = (modalBox.height - minHeight) / 2;\n }\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top + self.__dy,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height - self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top + self.__dy,\n width: modalBox.width + self.__dx,\n height: modalBox.height - self.__dy\n };\n }\n },\n \"bottom-left\": function(e) {\n if (minWidth > modalBox.width - self.__dx) {\n self.__dx = modalBox.width - minWidth;\n }\n\n if (minHeight > modalBox.height + self.__dy) {\n self.__dy = -modalBox.height + minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minWidth > modalBox.width - self.__dx * 2) {\n self.__dx = (modalBox.width - minWidth) / 2;\n }\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top - self.__dy,\n width: modalBox.width - self.__dx * 2,\n height: modalBox.height + self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left + self.__dx,\n top: modalOffset.top,\n width: modalBox.width - self.__dx,\n height: modalBox.height + self.__dy\n };\n }\n },\n \"bottom-right\": function(e) {\n if (minWidth > modalBox.width + self.__dx) {\n self.__dx = -modalBox.width + minWidth;\n }\n\n if (minHeight > modalBox.height + self.__dy) {\n self.__dy = -modalBox.height + minHeight;\n }\n\n if (e.shiftKey || e.altKey) {\n if (minWidth > modalBox.width + self.__dx * 2) {\n self.__dx = (-modalBox.width + minWidth) / 2;\n }\n if (minHeight > modalBox.height + self.__dy * 2) {\n self.__dy = (-modalBox.height + minHeight) / 2;\n }\n return {\n left: modalOffset.left - self.__dx,\n top: modalOffset.top - self.__dy,\n width: modalBox.width + self.__dx * 2,\n height: modalBox.height + self.__dy * 2\n };\n } else {\n return {\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width + self.__dx,\n height: modalBox.height + self.__dy\n };\n }\n }\n },\n getResizerPosition = function(e) {\n self.__dx = e.clientX - self.mousePosition.clientX;\n self.__dy = e.clientY - self.mousePosition.clientY;\n\n return resizerProcessor[resizerType](e);\n };\n\n let minWidth = 100,\n minHeight = 100;\n\n let cursorType = {\n top: \"row-resize\",\n bottom: \"row-resize\",\n left: \"col-resize\",\n right: \"col-resize\",\n \"top-left\": \"nwse-resize\",\n \"top-right\": \"nesw-resize\",\n \"bottom-left\": \"nesw-resize\",\n \"bottom-right\": \"nwse-resize\"\n };\n\n self.__dx = 0; // 변화량 X\n self.__dy = 0; // 변화량 Y\n\n // self.resizerBg : body 가 window보다 작을 때 문제 해결을 위한 DIV\n self.resizerBg = jQuery(\n ''\n );\n self.resizer = jQuery(\n ''\n );\n self.resizerBg.css({\n zIndex: modalZIndex,\n cursor: cursorType[resizerType]\n });\n self.resizer.css({\n left: modalOffset.left,\n top: modalOffset.top,\n width: modalBox.width,\n height: modalBox.height,\n zIndex: modalZIndex + 1,\n cursor: cursorType[resizerType]\n });\n jQuery(document.body)\n .append(self.resizerBg)\n .append(self.resizer);\n self.activeModal.addClass(\"draged\");\n\n jQuery(document.body)\n .bind(\n ENM[\"mousemove\"] + \".ax5modal-resize-\" + this.instanceId,\n function(e) {\n self.resizer.css(getResizerPosition(e));\n }\n )\n .bind(\n ENM[\"mouseup\"] + \".ax5modal-resize-\" + this.instanceId,\n function(e) {\n resizeModal.off.call(self);\n }\n )\n .bind(\"mouseleave.ax5modal-resize-\" + this.instanceId, function(\n e\n ) {\n resizeModal.off.call(self);\n });\n\n jQuery(document.body)\n .attr(\"unselectable\", \"on\")\n .css(\"user-select\", \"none\")\n .bind(\"selectstart\", false);\n },\n off: function() {\n let setModalPosition = function() {\n let box = this.resizer.offset();\n jQuery.extend(box, {\n width: this.resizer.width(),\n height: this.resizer.height()\n });\n if (!this.modalConfig.absolute) {\n box.left -= jQuery(document).scrollLeft();\n box.top -= jQuery(document).scrollTop();\n }\n this.activeModal.css(box);\n\n this.modalConfig.left = box.left;\n this.modalConfig.top = box.top;\n this.modalConfig.width = box.width;\n this.modalConfig.height = box.height;\n this.$[\"body\"].css({\n height: box.height - this.modalConfig.headerHeight\n });\n if (this.modalConfig.iframe) {\n this.$[\"iframe-wrap\"].css({\n height: box.height - this.modalConfig.headerHeight\n });\n this.$[\"iframe\"].css({\n height: box.height - this.modalConfig.headerHeight\n });\n }\n\n box = null;\n };\n\n this.activeModal.removeClass(\"draged\");\n setModalPosition.call(this);\n\n this.resizer.remove();\n this.resizer = null;\n this.resizerBg.remove();\n this.resizerBg = null;\n\n onStateChanged.call(this, self.modalConfig, {\n self: this,\n state: \"resize\"\n });\n\n jQuery(document.body)\n .unbind(\n ENM[\"mousemove\"] + \".ax5modal-resize-\" + this.instanceId\n )\n .unbind(ENM[\"mouseup\"] + \".ax5modal-resize-\" + this.instanceId)\n .unbind(\"mouseleave.ax5modal-resize-\" + this.instanceId);\n\n jQuery(document.body)\n .removeAttr(\"unselectable\")\n .css(\"user-select\", \"auto\")\n .unbind(\"selectstart\");\n }\n };\n\n /// private end\n\n /**\n * Preferences of modal UI\n * @method ax5modal.setConfig\n * @param {Object} config - 클래스 속성값\n * @param {Number} [config.zIndex]\n * @param {Object} [config.position]\n * @param {String} [config.position.left=\"center\"]\n * @param {String} [config.position.top=\"middle\"]\n * @param {Number} [config.position.margin=10]\n * @param {String} [config.minimizePosition=\"bottom-right\"]\n * @param {Number} [config.width=300]\n * @param {Number} [config.height=400]\n * @param {Boolean} [config.closeToEsc=true]\n * @param {Boolean} [config.absolute=false]\n * @param {Boolean} [config.disableDrag=false]\n * @param {Boolean} [config.disableResize=false]\n * @param {Number} [config.animateTime=250]\n * @param {Function} [config.fullScreen]\n * @param {Function} [config.onStateChanged] - `onStateChanged` function can be defined in setConfig method or new ax5.ui.modal initialization method. However, you can us to define an event function after initialization, if necessary\n * @param {Function} [config.onResize]\n * @returns {ax5modal}\n * @example\n * ```js\n * var modal = new ax5.ui.modal({\n * iframeLoadingMsg: '',\n * header: {\n * title: \"MODAL TITLE\",\n * btns: {\n * minimize: {\n * label: '', onClick: function () {\n * modal.minimize();\n * }\n * },\n * maximize: {\n * label: '', onClick: function () {\n * modal.maximize();\n * }\n * },\n * close: {\n * label: '', onClick: function () {\n * modal.close();\n * }\n * }\n * }\n * }\n * });\n *\n * modal.open({\n * width: 800,\n * height: 600,\n * fullScreen: function(){\n * return ($(window).width() < 600);\n * },\n * iframe: {\n * method: \"get\",\n * url: \"http://chequer-app:2017/html/login.html\",\n * param: \"callback=modalCallback\"\n * },\n * onStateChanged: function(){\n * console.log(this);\n * },\n * onResize: function(){\n * console.log(this);\n * }\n * });\n * ```\n */\n //== class body start\n this.init = function() {\n this.onStateChanged = cfg.onStateChanged;\n this.onResize = cfg.onResize;\n };\n\n /**\n * open the modal\n * @method ax5modal.open\n * @returns {ax5modal}\n * @example\n * ```\n * modal.open();\n * modal.open({\n * width: 500,\n * height: 500\n * });\n * moaal.open({}, function(){\n * console.log(this);\n * });\n * ```\n */\n this.open = function(opts, callback, tryCount) {\n if (typeof tryCount === \"undefined\") tryCount = 0;\n if (!this.activeModal) {\n opts = self.modalConfig = jQuery.extend(true, {}, cfg, opts);\n open.call(this, opts, callback);\n this.watingModal = false;\n } else if (tryCount < 3) {\n // 3번까지 재 시도\n this.watingModal = true;\n setTimeout(\n function() {\n this.open(opts, callback, tryCount + 1);\n }.bind(this),\n cfg.animateTime\n );\n } else {\n // 열기 시도 종료\n this.watingModal = false;\n }\n return this;\n };\n\n /**\n * close the modal\n * @method ax5modal.close\n * @param _option\n * @returns {ax5modal}\n * @example\n * ```\n * my_modal.close();\n * my_modal.close({callback: function(){\n * // on close event\n * });\n * // close 함수에 callback을 전달하면 정확한 close 타이밍을 캐치할 수 있습니다\n * ```\n */\n\n this.close = function(_option) {\n let opts, that;\n\n if (this.activeModal) {\n opts = self.modalConfig;\n this.activeModal.addClass(\"destroy\");\n jQuery(window).unbind(\"keydown.ax-modal\");\n jQuery(window).unbind(\"resize.ax-modal\");\n\n setTimeout(\n function() {\n // 프레임 제거\n if (opts.iframe) {\n var $iframe = this.$[\"iframe\"]; // iframe jQuery Object\n if ($iframe) {\n var iframeObject = $iframe.get(0),\n idoc = iframeObject.contentDocument\n ? iframeObject.contentDocument\n : iframeObject.contentWindow.document;\n\n try {\n $(idoc.body)\n .children()\n .each(function() {\n $(this).remove();\n });\n } catch (e) {}\n idoc.innerHTML = \"\";\n $iframe.attr(\"src\", \"about:blank\").remove();\n\n // force garbarge collection for IE only\n window.CollectGarbage && window.CollectGarbage();\n }\n }\n\n this.activeModal.remove();\n this.activeModal = null;\n\n // 모달 오픈 대기중이면 닫기 상태 전달 안함.\n if (!this.watingModal) {\n onStateChanged.call(this, opts, {\n self: this,\n state: \"close\"\n });\n }\n\n if (_option && U.isFunction(_option.callback)) {\n that = {\n self: this,\n id: opts.id,\n theme: opts.theme,\n width: opts.width,\n height: opts.height,\n state: \"close\",\n $: this.$\n };\n _option.callback.call(that, that);\n }\n }.bind(this),\n cfg.animateTime\n );\n }\n\n this.minimized = false; // hoksi\n\n return this;\n };\n\n /**\n * @method ax5modal.minimize\n * @returns {ax5modal}\n */\n this.minimize = (function() {\n return function(minimizePosition) {\n if (this.minimized !== true) {\n var opts = self.modalConfig;\n if (typeof minimizePosition === \"undefined\")\n minimizePosition = cfg.minimizePosition;\n\n this.minimized = true;\n this.$.body.hide();\n self.modalConfig.originalHeight = opts.height;\n self.modalConfig.height = 0;\n alignProcessor[minimizePosition].call(this);\n\n onStateChanged.call(this, opts, {\n self: this,\n state: \"minimize\"\n });\n }\n\n return this;\n };\n })();\n\n /**\n * @method ax5modal.restore\n * @returns {ax5modal}\n */\n this.restore = function() {\n var opts = self.modalConfig;\n if (this.minimized) {\n this.minimized = false;\n this.$.body.show();\n self.modalConfig.height = self.modalConfig.originalHeight;\n self.modalConfig.originalHeight = undefined;\n\n this.align({ left: \"center\", top: \"middle\" });\n onStateChanged.call(this, opts, {\n self: this,\n state: \"restore\"\n });\n }\n return this;\n };\n\n /**\n * setCSS\n * @method ax5modal.css\n * @param {Object} css -\n * @returns {ax5modal}\n */\n this.css = function(css) {\n if (this.activeModal && !self.fullScreen) {\n this.activeModal.css(css);\n if (typeof css.width !== \"undefined\") {\n self.modalConfig.width = css.width;\n }\n if (typeof css.height !== \"undefined\") {\n self.modalConfig.height = css.height;\n }\n\n this.align();\n }\n return this;\n };\n\n /**\n * @method ax5modal.setModalConfig\n * @param _config\n * @returns {ax5.ui.ax5modal}\n */\n this.setModalConfig = function(_config) {\n self.modalConfig = jQuery.extend({}, self.modalConfig, _config);\n this.align();\n return this;\n };\n\n /**\n * @method ax5modal.align\n * @param position\n * @param e\n * @returns {ax5modal}\n * @example\n * ```js\n * modal.align({left:\"center\", top:\"middle\"});\n * modal.align({left:\"left\", top:\"top\", margin: 20});\n * ```\n */\n this.align = (function() {\n return function(position, e) {\n if (!this.activeModal) return this;\n\n var opts = self.modalConfig,\n box = {\n width: opts.width,\n height: opts.height\n };\n\n var fullScreen = (opts.isFullScreen = (function(_fullScreen) {\n if (typeof _fullScreen === \"undefined\") {\n return false;\n } else if (U.isFunction(_fullScreen)) {\n return _fullScreen();\n }\n })(opts.fullScreen));\n\n if (fullScreen) {\n if (opts.header) this.$.header.show();\n if (opts.header) {\n opts.headerHeight = this.$.header.outerHeight();\n box.height += opts.headerHeight;\n } else {\n opts.headerHeight = 0;\n }\n box.width = jQuery(window).width();\n box.height = opts.height;\n box.left = 0;\n box.top = 0;\n } else {\n if (opts.header) this.$.header.show();\n if (position) {\n jQuery.extend(true, opts.position, position);\n }\n\n if (opts.header) {\n opts.headerHeight = this.$.header.outerHeight();\n box.height += opts.headerHeight;\n } else {\n opts.headerHeight = 0;\n }\n\n //- position 정렬\n if (opts.position.left == \"left\") {\n box.left = opts.position.margin || 0;\n } else if (opts.position.left == \"right\") {\n // window.innerWidth;\n box.left =\n jQuery(window).width() -\n box.width -\n (opts.position.margin || 0);\n } else if (opts.position.left == \"center\") {\n box.left = jQuery(window).width() / 2 - box.width / 2;\n } else {\n box.left = opts.position.left || 0;\n }\n\n if (opts.position.top == \"top\") {\n box.top = opts.position.margin || 0;\n } else if (opts.position.top == \"bottom\") {\n box.top =\n jQuery(window).height() -\n box.height -\n (opts.position.margin || 0);\n } else if (opts.position.top == \"middle\") {\n box.top = jQuery(window).height() / 2 - box.height / 2;\n } else {\n box.top = opts.position.top || 0;\n }\n if (box.left < 0) box.left = 0;\n if (box.top < 0) box.top = 0;\n\n if (opts.absolute) {\n box.top += jQuery(window).scrollTop();\n box.left += jQuery(window).scrollLeft();\n }\n }\n\n this.activeModal.css(box);\n\n this.$[\"body\"].css({\n height: box.height - (opts.headerHeight || 0)\n });\n\n if (opts.iframe) {\n this.$[\"iframe-wrap\"].css({\n height: box.height - opts.headerHeight\n });\n this.$[\"iframe\"].css({ height: box.height - opts.headerHeight });\n } else {\n }\n return this;\n };\n })();\n\n // 클래스 생성자\n this.main = function() {\n UI.modal_instance = UI.modal_instance || [];\n UI.modal_instance.push(this);\n\n if (arguments && U.isObject(arguments[0])) {\n this.setConfig(arguments[0]);\n }\n }.apply(this, arguments);\n };\n })()\n );\n\n MODAL = ax5.ui.modal;\n})();\n","// ax5.ui.modal.tmpl\n(function () {\n var MODAL = ax5.ui.modal;\n\n var content = function () {\n return ` \n \n {{#header}}\n \n {{/header}}\n
\n {{#iframe}}\n
\n
\n {{/iframe}}\n {{^iframe}}\n
\n {{/iframe}}\n
\n {{^disableResize}}\n
\n
\n
\n
\n
\n
\n
\n
\n {{/disableResize}}\n
\n `;\n };\n\n MODAL.tmpl = {\n \"content\": content,\n\n get: function (tmplName, data, columnKeys) {\n return ax5.mustache.render(MODAL.tmpl[tmplName].call(this, columnKeys), data);\n }\n };\n})();"]}