{"version":3,"sources":["popup/Popup.js"],"names":["Popup","$","option","this","_option","_initChk","_$win","window","_$wrap","_btnSelector","btnSelector","_popupSelector","popupSelector","selector","_clone","undefined","clone","_panelClass","panelClass","_drag","drag","_dimmed","dimmed","_dimmedColor","dimmedColor","_$dimmed","class","_closeSelector","closeSelector","_okSelector","okSelector","_cancelSelector","cancelSelector","_yesSelector","yesSelector","_noSelector","noSelector","_$btn","addClass","hide","_$popup","eq","css","find","removeClass","after","_$popupBackup","_keyEvt","_this","bind","e","keyCode","each","i","data","target","filter","size","shiftKey","is","focus","getFocusIdx","parent","hasClass","length","_btnEvt","ok","cancel","yes","no","_rgbToHex","rgb","match","parseInt","toString","slice","fn","isScrollable","elem","hasScrollBar","get","scrollHeight","clientHeight","init","addEvt","prototype","_globalLayerDeleteHandler","classValue","destroy","unbind","idNum","count","attr","next","draggable","scroll","containment","handle","start","trigger","ui","obj","helper","andSelf","parents","position","z-index","left","top","width","height","display","cursor","background","navigator","appVersion","indexOf","opacity","replace","before","preventDefault","stopPropagation","show","has","subSelect","treeSet","$target","setTimeout","document","nextAll","outerWidth","outerHeight","margin-left","margin-top","removeAttr","disable","remove","enable","opts","self","btn","popup","jQuery"],"mappings":"AASA,IAAIA,MAAQ,SAAUC,GACrB,SAASD,MAAME,QACVA,SAEJC,KAAKC,QAAUF,OACfC,KAAKE,UAAW,EAChBF,KAAKG,MAAQL,EAAEM,QACfJ,KAAKK,OAASP,EAAE,QAEhBE,KAAKM,aAAeP,OAAOQ,YAC3BP,KAAKQ,eAAiBT,OAAOU,cACI,iBAAvBT,KAAKQ,iBAA4BR,KAAKQ,eAAiBR,KAAKQ,eAAeE,UACrFV,KAAKW,YAAyBC,GAAhBb,OAAOc,OAA6Bd,OAAOc,MACzDb,KAAKc,iBAAmCF,GAArBb,OAAOgB,WAA0B,KAAOhB,OAAOgB,WAElEf,KAAKgB,WAAuBJ,GAAfb,OAAOkB,MAA4BlB,OAAOkB,KACvDjB,KAAKkB,aAA2BN,GA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/Popup.js","sourcesContent":["/**\r\n * Popup.js\r\n * \r\n * create file\t2015-01-15\r\n * last update\t2015-07-24\r\n * \r\n * comment\r\n * 팝업\r\n */\r\nvar Popup = (function($){\r\n\tfunction Popup(option){\r\n\t\tif(!option) return;\r\n\t\t\r\n\t\tthis._option = option;\r\n\t\tthis._initChk = false;\r\n\t\tthis._$win = $(window);\r\n\t\tthis._$wrap = $('body');\r\n\r\n\t\tthis._btnSelector = option.btnSelector;\r\n\t\tthis._popupSelector = option.popupSelector;\r\n\t\tif(typeof this._popupSelector == 'object') this._popupSelector = this._popupSelector.selector;\r\n\t\tthis._clone = option.clone == undefined ? false : option.clone;\r\n\t\tthis._panelClass = option.panelClass == undefined ? null : option.panelClass;\r\n\t\t\r\n\t\tthis._drag = option.drag == undefined ? false : option.drag; \r\n\t\tthis._dimmed = option.dimmed == undefined ? true : option.dimmed;\r\n\t\tthis._dimmedColor = option.dimmedColor == undefined ? 'rgba(255,255,255,.0)' : option.dimmedColor; // 'rgba(255,255,255,.0)'\r\n\t\tthis._$dimmed = $('
' , {'class' : 'dimmed-layer'});\r\n\t\t\r\n\t\tthis._closeSelector = option.closeSelector == undefined ? '.pop-header button' : option.closeSelector;\r\n\t\tthis._okSelector = option.okSelector == undefined ? '.js-ok' : option.okSelector;\r\n\t\tthis._cancelSelector = option.cancelSelector == undefined ? '.js-cancel' : option.cancelSelector;\r\n\t\tthis._yesSelector = option.yesSelector == undefined ? '.js-yes' : option.yesSelector;\r\n\t\tthis._noSelector = option.noSelector == undefined ? '.js-no' : option.noSelector;\r\n\t\t\r\n\t\tthis._$btn = $(this._btnSelector).addClass('js-popup-btn');\r\n\t\tif(this._clone){\r\n\t\t\t$(this._popupSelector).hide();\r\n\t\t\tthis._$popup = $(this._popupSelector+':not(.js-popup)').eq(0).clone().addClass('js-popup').css('z-index' , '2000').hide();\r\n\t\t\tthis._$popup .find('.js-sub-select').removeClass('js-sub-select');\r\n\t\t\tthis._$popup .find('.js-sub-tree').removeClass('js-sub-tree');\r\n\t\t\t$(this._popupSelector+':not(.js-popup)').eq(0).after(this._$popup);\r\n\t\t} else {\r\n\t\t\tthis._$popup = $(this._popupSelector).addClass('js-popup').css('z-index' , '2000').hide();\r\n\t\t\tthis._$popupBackup = this._$popup.clone();\r\n\t\t}\r\n\r\n\t\tthis._keyEvt = function(){\r\n\t\t\tvar _this = this;\r\n\t\t\t\r\n\t\t\t// esc 키 닫기 20180726\r\n\t\t\tthis._$popup.bind('keydown.popup', function(e){\r\n\t\t\t\tif(e.keyCode == 27){\r\n\t\t\t\t\t_this.hide();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\r\n\t\t\t// 레이어박스에 a, button, input 에 data값 설정 (포커스 제어 위해서)\r\n\t\t\tthis._$popup.find('a, button, input').each(function(i){\r\n\t\t\t\t$(this).data('popup-focus-idx' , i);\r\n\t\t\t});\r\n\r\n\t\t\t// 탭 , 위, 아래\r\n\t\t\tthis._$popup.bind('keydown.popup', function(e){\r\n\t\t\t\t// 탭키 포커스 제어\r\n\r\n \t\t\tif($(e.target).filter(':input').size() > 0) return;\r\n\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t\tif( e.keyCode == 9 && e.shiftKey){\r\n\t\t\t\t\tif($(this).is(':focus')){\r\n\t\t\t\t\t\t$(this).find('a:visible, button:visible, input:visible').eq(-1).focus();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// up , left\r\n\t\t\t\tif(e.keyCode == 38 || e.keyCode == 37){\r\n\t\t\t\t\tif($(this).is(':focus')){\r\n\t\t\t\t\t\t$(this).find('a:visible, button:visible, input:visible').eq(-1).focus();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar getFocusIdx = $(this).find(':focus').data('popup-focus-idx');\r\n\t\t\t\t\t\tfor(var i=getFocusIdx; i>=0; i--){\r\n\t\t\t\t\t\t\tgetFocusIdx--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// getFocusIdx의 포커스 이동할 영역이 보이거나 인풋태그면서 보이거나\r\n\t\t\t\t\t\t\tif($(this).find('a, button, input').eq(getFocusIdx).is(':visible') || \r\n\t\t\t\t\t\t\t\t($(this).find('a, button, input').eq(getFocusIdx).parent().hasClass('check') && $(this).find('a, button, input').eq(getFocusIdx).parent().is(':visible')) ||\r\n\t\t\t\t\t\t\t\t($(this).find('a, button, input').eq(getFocusIdx).parent().hasClass('radio-des') && $(this).find('a, button, input').eq(getFocusIdx).parent().is(':visible')) ){\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).find('a, button, input').eq(getFocusIdx).focus();\r\n\t\t\t\t\t\tif(getFocusIdx < 0){\r\n\t\t\t\t\t\t\t$(this).find('a:visible, button:visible, input:visible').eq(-1).focus();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// down , right\r\n\t\t\t\tif(e.keyCode == 40 || e.keyCode == 39){\r\n\t\t\t\t\tif($(this).is(':focus')){\r\n\t\t\t\t\t\t$(this).find('a:visible, button:visible, input:visible').eq(0).focus();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar getFocusIdx = $(this).find(':focus').data('popup-focus-idx');\r\n\t\t\t\t\t\tfor(var i=getFocusIdx; i<$(this).find('a, button, input').length; i++){\r\n\t\t\t\t\t\t\tgetFocusIdx++;\r\n\t\t\t\t\t\t\tif(getFocusIdx >= $(this).find('a, button, input').length){\r\n\t\t\t\t\t\t\t\tgetFocusIdx = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// getFocusIdx의 포커스 이동할 영역이 보이거나 인풋태그면서 보이거나\r\n\t\t\t\t\t\t\tif($(this).find('a, button, input').eq(getFocusIdx).is(':visible') || \r\n\t\t\t\t\t\t\t\t($(this).find('a, button, input').eq(getFocusIdx).parent().hasClass('check') && $(this).find('a, button, input').eq(getFocusIdx).parent().is(':visible')) ||\r\n\t\t\t\t\t\t\t\t($(this).find('a, button, input').eq(getFocusIdx).parent().hasClass('radio-des') && $(this).find('a, button, input').eq(getFocusIdx).parent().is(':visible')) ){\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$(this).find('a, button, input').eq(getFocusIdx).focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// 탭키 포커스 제어\r\n\t\t\tthis._$popup.find('a, button, input').eq(-1).bind('keydown.popup', function(e){\r\n\t\t\t\tif(e.keyCode == 9 && !e.shiftKey){\r\n\t\t\t\t\tif($(this).is(':focus')){\r\n\t\t\t\t\t\t_this._$popup.focus();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\t// 버튼 종류 추후에 이벤트 추가\r\n\t\t// 확인(ok), 취소(cancel), 예(yes), 아니오(no), 저장(save), 검색(search), 이동(move), 계속 이동, 상신취소, 불러오기\r\n\t\tthis._btnEvt = function(){\r\n\t\t\tvar _this = this;\r\n\r\n\t\t\t// ok\r\n\t\t\tif(typeof (this._option.ok) === 'function'){\r\n\t\t\t\tthis._$popup.find(this._okSelector).bind('click.popup', function(){\r\n\t\t\t\t\t_this._option.ok();\r\n\t\t\t\t\t//_this.hide();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// cancel\r\n\t\t\tif(typeof (this._option.cancel) === 'function'){\r\n\t\t\t\tthis._$popup.find(this._cancelSelector).bind('click.popup', function(){\r\n\t\t\t\t\t_this._option.cancel();\r\n\t\t\t\t\t//_this.hide();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// yes\r\n\t\t\tif(typeof (this._option.yes) === 'function'){\r\n\t\t\t\tthis._$popup.find(this._yesSelector).bind('click.popup', function(){\r\n\t\t\t\t\t_this._option.yes();\r\n\t\t\t\t\t//_this.hide();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// no\r\n\t\t\tif(typeof (this._option.no) === 'function'){\r\n\t\t\t\tthis._$popup.find(this._noSelector).bind('click.popup', function(){\r\n\t\t\t\t\t_this._option.no();\r\n\t\t\t\t\t//_this.hide();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close\r\n\t\t\tthis._$popup.find(this._closeSelector).bind('click.popup', function(){\r\n\t\t\t\t_this.hide();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis._rgbToHex = function(rgb){\r\n\t\t\trgb = rgb.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i);\r\n\t\t\treturn (rgb && rgb.length === 4) ? \"#\" +\r\n\t\t\t(\"0\" + parseInt(rgb[1],10).toString(16)).slice(-2) +\r\n\t\t\t(\"0\" + parseInt(rgb[2],10).toString(16)).slice(-2) +\r\n\t\t\t(\"0\" + parseInt(rgb[3],10).toString(16)).slice(-2) : '';\r\n\t\t}\r\n\t\t\r\n\t\t$.fn.isScrollable = function(){\r\n\t\t\tvar elem = $(this);\r\n\t\t\treturn (\r\n\t\t\telem.css('overflow') == 'scroll'\r\n\t\t\t\t|| elem.css('overflow') == 'auto'\r\n\t\t\t\t|| elem.css('overflow-x') == 'scroll'\r\n\t\t\t\t|| elem.css('overflow-x') == 'auto'\r\n\t\t\t\t|| elem.css('overflow-y') == 'scroll'\r\n\t\t\t\t|| elem.css('overflow-y') == 'auto'\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\t$.fn.hasScrollBar = function (){\r\n\t\t\treturn this.get(0).scrollHeight > this.get(0).clientHeight;\r\n\t\t}\r\n\t\t\r\n\t\tthis.init();\r\n\r\n\t\t// 이벤트 추가\r\n\t\tif(typeof (this._option.addEvt) === 'function'){\r\n\t\t\tthis.addEvt();\r\n\t\t}\r\n\t}\r\n\t\r\n\tPopup.prototype.init = function(){\r\n\t\tif(this._initChk) return;\r\n\r\n\t\tvar _this = this;\r\n\t\t\r\n\t\tthis._globalLayerDeleteHandler = function(e , classValue){\r\n\t\t\tif(_this._panelClass == classValue){\r\n\t\t\t\t_this.destroy();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// 인스턴스 생성될때 같은 이름의 경우 자체 디스토리 시키기\r\n\t\tif(this._panelClass != null){\r\n\t\t\t$(window).unbind('customEvent.globalLayerDelete' , this._globalLayerDeleteHandler);\r\n\t\t\t$(window).bind('customEvent.globalLayerDelete' , this._globalLayerDeleteHandler);\r\n\t\t}\r\n\r\n\t\t// 클론 시 레이어안 인풋요소 아이디, 네임값, 레이블 for 속성값 변경필요\r\n\t\tif(this._clone){\r\n\t\t\tif(this._$popup.find('input').length > 0){\r\n\t\t\t\tvar idNum = 0;\r\n\t\t\t\tthis._$popup.find('input').each(function(){\r\n\t\t\t\t\tidNum++;\r\n\t\t\t\t\tvar count = '_popup'+ $('.js-popup').length + '_' +idNum;\r\n\t\t\t\t\t$(this).attr('id' , $(this).attr('id') + count);\r\n\t\t\t\t\t$(this).attr('name' , $(this).attr('name') + $('.js-popup').length);\r\n\t\t\t\t\t$(this).next('label').attr('for' , $(this).next('label').attr('for') + count);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// 버튼에 인덱스값 부여 ( 활성화된 버튼 알기 위해 )\r\n\t\tthis._$btn.each(function(i){\r\n\t\t\t$(this).data('popup-btn-idx' , i);\r\n\t\t});\r\n\t\t\r\n\t\tif(this._drag){\r\n\t\t\t// 스크롤영역 체크\r\n\t\t\tthis._$popup.find('*').each(function(){\r\n\t\t\t\tif($(this).isScrollable() || $(this).hasScrollBar() ){\r\n\t\t\t\t\t$(this).addClass('js-has-scroll');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis._$popup.draggable({\r\n\t\t\t\tscroll: false,\r\n\t\t\t\tcontainment: this._$wrap,\r\n\t\t\t\thandle: '.pop-header',\r\n\t\t\t\tstart: function(e) {\r\n\t\t\t\t\tif($(this).data('scrolled')){\r\n\t\t\t\t\t\t$(this).data('scrolled', false).trigger('mouseup');\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdrag : function(e, ui){\r\n\t\t\t\t\tvar obj = ui.helper;\r\n\t\t\t\t\t// 팝업에서 드래그시 열린 셀렉트 메뉴 닫기\r\n\t\t\t\t\tif(obj.find('.js-layer-btn.js-active-select').length > 0){\r\n\t\t\t\t\t\tobj.find('.js-layer-btn.js-active-select').trigger('layerHide');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).find('*').andSelf().bind('scroll.popup' , function(){\r\n\t\t\t\t$(this).parents('.ui-draggable').data('scrolled', true);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this._dimmed){\r\n\t\t\tthis._$dimmed.css({\r\n\t\t\t\t'position' : 'absolute',\r\n\t\t\t\t'z-index' : '2000',\r\n\t\t\t\t'left' : 0,\r\n\t\t\t\t'top' : 0,\r\n\t\t\t\t'width' : '100%',\r\n\t\t\t\t'height' : '100%',\r\n\t\t\t\t'display' : 'none',\r\n\t\t\t\t'cursor' : 'default',\r\n\t\t\t\t'background' : this._dimmedColor\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// ie 7,8 체크 ( background 에 rgba값이 적용되지 않기 때문에 )\r\n\t\t\tif(navigator.appVersion.indexOf(\"MSIE 8.\")!=-1 || navigator.appVersion.indexOf(\"MSIE 7.\")!=-1){\r\n\t\t\t\tthis._$dimmed.css({\r\n\t\t\t\t\t'background' : this._rgbToHex(this._dimmedColor),\r\n\t\t\t\t\t'opacity' : this._dimmedColor.replace(/^.*,(.+)\\)/,'$1')\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis._$popup.before(this._$dimmed);\r\n\t\t\tthis._$dimmed.bind('click.popup' , function(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\t\r\n\t\t\t\t// 팝업위에 셀렉트 메뉴 있을시에 딤드 클릭시 셀렉트 닫기\r\n\t\t\t\tif(_this._$dimmed.next('.js-popup').find('.js-layer-btn').length > 0){\r\n\t\t\t\t\t_this._$dimmed.next('.js-popup').find('.js-layer-btn').trigger('layerHide');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis._keyEvt(); // 키 이벤트 ( 포커스 제어 하기 위해 )\r\n\t\tthis._btnEvt(); // 버튼 이벤트\r\n\t\t\r\n\t\t// 레이어 보기 이벤트\r\n\t\tthis._$btn.bind('click.popup', function(e){\r\n\t\t\t//e.stopPropagation();\r\n\t\t\t_this._$popup.data('popup-btn-idx' , $(this).data('popup-btn-idx'));\r\n\t\t\t_this.show($(this));\r\n\t\t});\r\n\r\n\t\t// Popup 인스턴스 위에 SelectMenu가 떠야 할 경우 ( 팝업 클릭시 셀렉트메뉴 숨기기 위해)\r\n\t\tthis._$popup.bind('click.popup' , function(e){\r\n\t\t\te.stopPropagation();\r\n\r\n\t\t\t// SelectMenu\r\n\t\t\tif(!_this._$popup.find('.js-layer-btn.js-active-select').is(e.target) && _this._$popup.find('.js-layer-btn.js-active-select').has(e.target).length === 0 ){\r\n\t\t\t\t_this._$popup.find('.js-layer-btn.js-active-select').trigger('layerHide');\r\n\t\t\t}\r\n\t\t\t// subSelect\r\n\t\t\tif(!_this._$popup.find('.select02.js-sub-select').is(e.target) && _this._$popup.find('.select02.js-sub-select').has(e.target).length === 0 ){\r\n\t\t\t\t_this._$popup.find('.select02.js-sub-select').trigger('layerHide');\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t// 서브플러그인 있을경우\r\n\t\tif(this._$popup.find('.select02:not(.js-sub-select)').length > 0){\r\n\t\t\tthis._$popup.find('.select02:not(.js-sub-select)').subSelect();\r\n\t\t}\r\n\t\tif(this._$popup.find('.tree-st01:not(.js-sub-tree)').length > 0){\r\n\t\t\tthis._$popup.find('.tree-st01:not(.js-sub-tree)').treeSet();\r\n\t\t}\r\n\t\t\r\n\t\tthis._initChk = true;\r\n\t}\r\n\t\r\n\tPopup.prototype.show = function(target){\r\n\t\tvar _this = this;\r\n\t\tvar $target = target;\r\n\t\t\r\n\t\tif(!this._dimmed){\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\t// 딤드가 false 일때 바닥 클릭시\r\n\t\t\t\t\r\n\t\t\t\t$(document).bind('click.popup_' + this._popupSelector, function(e){\r\n\t\t\t\t\t// 2015-07-24 일정 상세검색 datepicker 이전월 다음월 변경시 레이어 닫히지 않도록 예외처리\r\n\t\t\t\t\tif($(e.target).hasClass('ui-icon-circle-triangle-w') || $(e.target).hasClass('ui-icon-circle-triangle-e')) return;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!$(_this._popupSelector).is(e.target) && $(_this._popupSelector).has(e.target).length === 0 \r\n\t\t\t\t\t\t&& _this._$popup.is(':visible')\r\n\t\t\t\t\t\t&& !$('.js-layer-box').is(e.target) && $('.js-layer-box').has(e.target).length === 0 \r\n\t\t\t\t\t\t&& !$(_this._btnSelector).is(e.target) && $(_this._btnSelector).has(e.target).length === 0){\r\n\t\t\t\t\t\t// _this._$popup 다음 노드중에 $('.dimmed-layer:visible').length <= 0 일때 하이드\r\n\t\t\t\t\t\tif(_this._$popup.nextAll('.dimmed-layer:visible').length <= 0){\r\n\t\t\t\t\t\t\t_this.hide();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}, 0);\r\n\t\t}\r\n\t\t\r\n\t\t// TODO 2015-03-06\r\n\t\t/*\r\n\t\t// 보여지는 팝업이 있을경우 숨김\r\n\t\tif($('.js-popup').is(':visible')){\r\n\t\t\t//$('.js-popup').removeAttr('tabindex').hide();\r\n\r\n\t\t\t// dimmed 있을경우 숨김\r\n\t\t\tif($('.dimmed-layer').is(':visible')){\r\n\t\t\t\t//$('.dimmed-layer').hide();\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\tif(this._btnSelector != undefined && $target != undefined){\r\n\t\t\t$('.js-popup-btn').removeClass('on');\r\n\t\t\t//$target.addClass('on');\r\n\t\t}\r\n\t\t\r\n\t\tthis._$popup.attr('tabindex' , '0').css({\r\n\t\t\t'left' : ($(window).width() / 2) - (_this._$popup.outerWidth(true) / 2),\r\n\t\t\t'top' : ($(window).height() / 2) - (_this._$popup.outerHeight(true) / 2),\r\n\t\t\t'margin-left' : 0,\r\n\t\t\t'margin-top' : 0\r\n\t\t}).show().focus();\r\n\r\n\t\tif(this._dimmed){\r\n\t\t\tthis._$dimmed.show();\r\n\t\t}\r\n\t\t\r\n\t\t// 포커스 제어\r\n\t\t/* 2015-03-31\r\n\t\tvar time;\r\n\t\tif(time) clearTimeout(time);\r\n\t\ttime = setTimeout(function(){\r\n\t\t\t_this._$popup.focus();\r\n\t\t} , 20 );\r\n\t\t*/\r\n\r\n\t\t$(window).bind('resize.popup_' + this._popupSelector, function(){\r\n\t\t\t_this._$popup.css({\r\n\t\t\t\t'left' : ($(window).width() / 2) - (_this._$popup.outerWidth(true) / 2),\r\n\t\t\t\t'top' : ($(window).height() / 2) - (_this._$popup.outerHeight(true) / 2),\r\n\t\t\t\t'margin-left' : 0,\r\n\t\t\t\t'margin-top' : 0\r\n\t\t\t})\r\n\t\t});\r\n\t\t\r\n\t\t// 현재 활성화된 버튼 클래스 주기\r\n\t\tif(this._btnSelector != undefined && $target != undefined){\r\n\t\t\t$('.js-active-popup').removeClass('js-active-popup');\r\n\t\t\t$target.addClass('js-active-popup');\r\n\t\t}\r\n\t\t\r\n\t\t// show callback\r\n\t\tif(typeof (this._option.show) === 'function'){\r\n\t\t\tthis._option.show(this._$btn.eq(this._$popup.data('popup-btn-idx')) , this._$popup);\r\n\t\t}\r\n\t\t\r\n\t\t// 2015-08-20 팝업에 생성된 sub-select메뉴가 팝업안쪽에 가려 안보일때 위로 올라가도록 처리\r\n\t\t/*if(this._$popup.find('.js-sub-select').length > 0){\r\n\t\t\tthis._$popup.find('.js-sub-select').each(function(i, tg){\r\n\t\t\t\tvar $tg = $(tg);\r\n\t\t\t\tvar popupHeight = _this._$popup.outerHeight();\r\n\t\t\t\tvar layerTH = $tg.find('.layer-list').outerHeight() + $tg.position().top + $tg.outerHeight();\r\n\t\t\t\tif(popupHeight < layerTH) $tg.find('.layer-list').addClass('st02').css('top','auto');\r\n\t\t\t});\t\r\n\t\t}*/\r\n\t}\r\n\t\r\n\tPopup.prototype.hide = function(){\r\n\t\t// hide callback\r\n\t\tif(typeof (this._option.hide) === 'function'){\r\n\t\t\tthis._option.hide(this._$btn.eq(this._$popup.data('popup-btn-idx')) , this._$popup);\r\n\t\t}\r\n\r\n\t\tvar _this = this;\r\n\r\n\t\tif(this._btnSelector != undefined) this._$btn.eq(this._$popup.data('popup-btn-idx')).removeClass('on').removeClass('js-active-popup').focus();\r\n\t\tthis._$popup.removeAttr('tabindex').hide();\r\n\t\t\r\n\t\tif(!this._dimmed){\r\n\t\t\tif(!$('.js-popup').is(':visible')){\r\n\t\t\t\t$(document).unbind('click.popup_' + this._popupSelector);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this._dimmed){\r\n\t\t\tthis._$dimmed.hide();\r\n\t\t}\r\n\r\n\t\t$(window).unbind('resize.popup_' + this._popupSelector);\r\n\t}\r\n\r\n\tPopup.prototype.disable = function(){\r\n\t\tif(!this._initChk) return;\r\n\t\t\r\n\t\tif(this._btnSelector != undefined) this._$btn.removeClass('on').removeClass('js-active-popup').removeClass('js-popup-btn');\r\n\t\tthis._$popup.removeClass('js-popup').removeAttr('tabindex').hide();\r\n\t\t$(document).unbind('.popup_' + this._popupSelector);\r\n\t\t$(window).unbind('resize.popup_' + this._popupSelector);\r\n\t\t\r\n\t\tif(this._btnSelector != undefined) this._$btn.unbind('.popup');\r\n\t\tthis._$popup.unbind('.popup');\r\n\t\tthis._$popup.find('a, button, input').eq(-1).unbind('.popup');\r\n\r\n\t\tthis._$popup.find(this._closeSelector).unbind('.popup');\r\n\t\t\r\n\t\tif(this._drag){\r\n\t\t\tif(this._$popup.draggable('instance') != undefined) this._$popup.draggable('destroy');\r\n\t\t\tthis._$popup.find('*').andSelf().unbind('scroll.popup');\r\n\t\t}\r\n\t\tif(this._dimmed){\r\n\t\t\tthis._$dimmed.unbind('.popup');\r\n\t\t\tthis._$dimmed.remove();\r\n\t\t}\r\n\r\n\t\t// all events unbind\r\n\t\tthis._$popup.unbind();\r\n\t\tthis._$popup.find('*').unbind();\r\n\r\n\t\tthis._initChk = false;\r\n\t}\r\n\t\r\n\tPopup.prototype.enable= function(){\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tPopup.prototype.destroy = function(){\r\n\t\tthis.disable();\r\n\t\tif(this._clone){\r\n\t\t\tthis._$popup.remove();\r\n\t\t} else {\r\n\t\t\tthis._$popup.after(this._$popupBackup);\r\n\t\t\tthis._$popup.remove();\r\n\t\t}\r\n\r\n\t\t$(window).unbind('customEvent.globalLayerDelete' , this._globalLayerDeleteHandler);\r\n\t\t$(window).unbind('resize.popup_' + this._popupSelector);\r\n\r\n\t\tthis._option = null;\r\n\t\tthis._initChk = null;\r\n\t\tthis._$win = null;\r\n\t\tthis._$wrap = null;\r\n\t\tthis._btnSelector = null;\r\n\t\tthis._popupSelector = null;\r\n\t\tthis._clone = null;\r\n\t\tthis._panelClass = null;\r\n\t\tthis._drag = null;\r\n\t\tthis._dimmed = null;\r\n\t\tthis._dimmedColor = null;\r\n\t\tthis._$dimmed = null;\r\n\t\tthis._closeSelector = null;\r\n\t\tthis._okSelector = null;\r\n\t\tthis._cancelSelector = null;\r\n\t\tthis._yesSelector = null;\r\n\t\tthis._noSelector = null;\r\n\t\tthis._$btn = null;\r\n\t\tthis._$popupBackup = null;\r\n\t\tthis._keyEvt = null;\r\n\t\tthis._btnEvt = null;\r\n\t\tthis._rgbToHex = null;\r\n\t\tthis.init = null;\r\n\t\tthis.show = null;\r\n\t\tthis.hide = null;\r\n\t\tthis.disable = null;\r\n\t\tthis.enable = null;\r\n\t\tthis.addEvt = null;\r\n\t\tthis.destroy = null;\r\n\t}\r\n\t\r\n\tPopup.prototype.addEvt = function(){\r\n\t\tvar opts = {\r\n\t\t\tself : this,\r\n\t\t\tbtn : this._$btn,\r\n\t\t\tpopup : this._$popup\r\n\t\t}\r\n\t\tthis._option.addEvt(opts);\r\n\t}\r\n\r\n\treturn Popup;\r\n})(jQuery);"]}