You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
111 KiB

{"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","info","supportTouch","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","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,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,SAKAA,KAAAqK,KAAA,WACA9K,EAAA+K,eAAA/K,EAAA+K,mBACA/K,EAAA+K,eAAAC,KAAAvK,MAEAwK,WAAA9K,EAAA+K,SAAAD,UAAA,KACAxK,KAAA0K,UAAAF,UAAA,KAEAG,MAAA3K,KAAAwK,gBAKA5K,EAAAJ,IAAAC,GAAAmL,SCnuCA,WACA,GAAAhL,GAAAJ,IAAAC,GAAAmL,MAEAC,EAAA,WACA,MAAA,uzEA+CAjL,GAAA4D,MACAqH,QAAAA,EAEApH,IAAA,SAAAqH,EAAA9H,EAAA+H,GACA,MAAAvL,KAAAwL,SAAAC,OAAArL,EAAA4D,KAAAsH,GAAAnI,KAAA3C,KAAA+K,GAAA/H","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: ax5.info.supportTouch ? \"touchstart\" : \"mousedown\",\n mousemove: ax5.info.supportTouch ? \"touchmove\" : \"mousemove\",\n mouseup: ax5.info.supportTouch ? \"touchend\" : \"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('<div class=\"ax5modal-resizer-background\" ondragstart=\"return false;\"></div>');\n self.resizer = jQuery('<div class=\"ax5modal-resizer\" ondragstart=\"return false;\"></div>');\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('<div class=\"ax5modal-resizer-background\" ondragstart=\"return false;\"></div>');\n self.resizer = jQuery('<div class=\"ax5modal-resizer\" ondragstart=\"return false;\"></div>');\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: '<i class=\"fa fa-spinner fa-5x fa-spin\" aria-hidden=\"true\"></i>',\n * header: {\n * title: \"MODAL TITLE\",\n * btns: {\n * minimize: {\n * label: '<i class=\"fa fa-minus-circle\" aria-hidden=\"true\"></i>', onClick: function () {\n * modal.minimize();\n * }\n * },\n * maximize: {\n * label: '<i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>', onClick: function () {\n * modal.maximize();\n * }\n * },\n * close: {\n * label: '<i class=\"fa fa-times-circle\" aria-hidden=\"true\"></i>', 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 <div id=\\\"{{modalId}}\\\" data-modal-els=\\\"root\\\" class=\\\"ax5modal {{theme}} {{fullscreen}}\\\" style=\\\"{{styles}}\\\">\\n {{#header}}\\n <div class=\\\"ax-modal-header\\\" data-modal-els=\\\"header\\\">\\n {{{title}}}\\n {{#btns}}\\n <div class=\\\"ax-modal-header-addon\\\">\\n {{#@each}}\\n <button tabindex=\\\"-1\\\" data-modal-header-btn=\\\"{{@key}}\\\" class=\\\"{{@value.theme}}\\\">{{{@value.label}}}</button>\\n {{/@each}}\\n </div>\\n {{/btns}}\\n </div>\\n {{/header}}\\n <div class=\\\"ax-modal-body\\\" data-modal-els=\\\"body\\\">\\n {{#iframe}}\\n <div data-modal-els=\\\"iframe-wrap\\\" style=\\\"-webkit-overflow-scrolling: touch; overflow: auto;position: relative;\\\">\\n <table data-modal-els=\\\"iframe-loading\\\" style=\\\"width:100%;height:100%;\\\"><tr><td style=\\\"text-align: center;vertical-align: middle\\\">{{{iframeLoadingMsg}}}</td></tr></table>\\n <iframe name=\\\"{{modalId}}-frame\\\" src=\\\"\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" data-modal-els=\\\"iframe\\\" style=\\\"position: absolute;left:0;top:0;\\\"></iframe>\\n </div>\\n <form name=\\\"{{modalId}}-form\\\" data-modal-els=\\\"iframe-form\\\">\\n <input type=\\\"hidden\\\" name=\\\"modalId\\\" value=\\\"{{modalId}}\\\" />\\n {{#param}}\\n {{#@each}}\\n <input type=\\\"hidden\\\" name=\\\"{{@key}}\\\" value=\\\"{{@value}}\\\" />\\n {{/@each}}\\n {{/param}}\\n </form>\\n {{/iframe}}\\n {{^iframe}}\\n <div data-modal-els=\\\"body-frame\\\" style=\\\"position: absolute;left:0;top:0;width:100%;height:100%;\\\"></div>\\n {{/iframe}}\\n </div>\\n {{^disableResize}}\\n <div data-ax5modal-resizer=\\\"top\\\"></div>\\n <div data-ax5modal-resizer=\\\"right\\\"></div>\\n <div data-ax5modal-resizer=\\\"bottom\\\"></div>\\n <div data-ax5modal-resizer=\\\"left\\\"></div>\\n <div data-ax5modal-resizer=\\\"top-left\\\"></div>\\n <div data-ax5modal-resizer=\\\"top-right\\\"></div>\\n <div data-ax5modal-resizer=\\\"bottom-left\\\"></div>\\n <div data-ax5modal-resizer=\\\"bottom-right\\\"></div>\\n {{/disableResize}}\\n </div>\\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: ax5.info.supportTouch ? \"touchstart\" : \"mousedown\",\n mousemove: ax5.info.supportTouch ? \"touchmove\" : \"mousemove\",\n mouseup: ax5.info.supportTouch ? \"touchend\" : \"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 '<div class=\"ax5modal-resizer-background\" ondragstart=\"return false;\"></div>'\n );\n self.resizer = jQuery(\n '<div class=\"ax5modal-resizer\" ondragstart=\"return false;\"></div>'\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 '<div class=\"ax5modal-resizer-background\" ondragstart=\"return false;\"></div>'\n );\n self.resizer = jQuery(\n '<div class=\"ax5modal-resizer\" ondragstart=\"return false;\"></div>'\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: '<i class=\"fa fa-spinner fa-5x fa-spin\" aria-hidden=\"true\"></i>',\n * header: {\n * title: \"MODAL TITLE\",\n * btns: {\n * minimize: {\n * label: '<i class=\"fa fa-minus-circle\" aria-hidden=\"true\"></i>', onClick: function () {\n * modal.minimize();\n * }\n * },\n * maximize: {\n * label: '<i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>', onClick: function () {\n * modal.maximize();\n * }\n * },\n * close: {\n * label: '<i class=\"fa fa-times-circle\" aria-hidden=\"true\"></i>', 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 <div id=\"{{modalId}}\" data-modal-els=\"root\" class=\"ax5modal {{theme}} {{fullscreen}}\" style=\"{{styles}}\">\n {{#header}}\n <div class=\"ax-modal-header\" data-modal-els=\"header\">\n {{{title}}}\n {{#btns}}\n <div class=\"ax-modal-header-addon\">\n {{#@each}}\n <button tabindex=\"-1\" data-modal-header-btn=\"{{@key}}\" class=\"{{@value.theme}}\">{{{@value.label}}}</button>\n {{/@each}}\n </div>\n {{/btns}}\n </div>\n {{/header}}\n <div class=\"ax-modal-body\" data-modal-els=\"body\">\n {{#iframe}}\n <div data-modal-els=\"iframe-wrap\" style=\"-webkit-overflow-scrolling: touch; overflow: auto;position: relative;\">\n <table data-modal-els=\"iframe-loading\" style=\"width:100%;height:100%;\"><tr><td style=\"text-align: center;vertical-align: middle\">{{{iframeLoadingMsg}}}</td></tr></table>\n <iframe name=\"{{modalId}}-frame\" src=\"\" width=\"100%\" height=\"100%\" frameborder=\"0\" data-modal-els=\"iframe\" style=\"position: absolute;left:0;top:0;\"></iframe>\n </div>\n <form name=\"{{modalId}}-form\" data-modal-els=\"iframe-form\">\n <input type=\"hidden\" name=\"modalId\" value=\"{{modalId}}\" />\n {{#param}}\n {{#@each}}\n <input type=\"hidden\" name=\"{{@key}}\" value=\"{{@value}}\" />\n {{/@each}}\n {{/param}}\n </form>\n {{/iframe}}\n {{^iframe}}\n <div data-modal-els=\"body-frame\" style=\"position: absolute;left:0;top:0;width:100%;height:100%;\"></div>\n {{/iframe}}\n </div>\n {{^disableResize}}\n <div data-ax5modal-resizer=\"top\"></div>\n <div data-ax5modal-resizer=\"right\"></div>\n <div data-ax5modal-resizer=\"bottom\"></div>\n <div data-ax5modal-resizer=\"left\"></div>\n <div data-ax5modal-resizer=\"top-left\"></div>\n <div data-ax5modal-resizer=\"top-right\"></div>\n <div data-ax5modal-resizer=\"bottom-left\"></div>\n <div data-ax5modal-resizer=\"bottom-right\"></div>\n {{/disableResize}}\n </div>\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})();"]}