ax5ui-docker
Advanced tools
Comparing version 1.3.103 to 1.3.104
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.3.103", | ||
"version": "1.3.104", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -16,3 +16,3 @@ "use strict"; | ||
className: "docker", | ||
version: "1.3.103" | ||
version: "1.3.104" | ||
}, function () { | ||
@@ -112,2 +112,16 @@ | ||
/** | ||
* 패널을 이용하여 패널의 부모 패널을 가져옵니다 | ||
* @param _panel | ||
*/ | ||
var getPanelParent = function getPanelParent(_panel) { | ||
var _path = _panel.panelPath.substr(0, _panel.panelPath.lastIndexOf(".")); | ||
try { | ||
return Function("", "return this." + _path + ";").call(_this); | ||
} catch (e) { | ||
console.log(e); | ||
return; | ||
} | ||
}; | ||
/** | ||
* 패널패스를 이용하여 패널오브젝트에 값을 부여합니다. | ||
@@ -562,3 +576,3 @@ * @param _panelPath | ||
}).on("drop.ax5docker-" + _this.instanceId, function (e) { | ||
panelTabDragEvent.off(); | ||
panelTabDragEvent.off("drop"); | ||
U.stopEvent(e); | ||
@@ -671,3 +685,7 @@ }).on("dragend.ax5docker-" + _this.instanceId, function (e) { | ||
}, | ||
"off": function off() { | ||
"off": function off(isDrop) { | ||
if (isDrop) { | ||
console.log(_this.xvar.dragger); | ||
} | ||
_this.$target.off("dragover.ax5docker-" + _this.instanceId).off("drop.ax5docker-" + _this.instanceId).off("dragend.ax5docker-" + _this.instanceId); | ||
@@ -886,12 +904,16 @@ | ||
this.addPanel = function (_addPath, _addType, _panel, _panelIndex) { | ||
if (_addPath == "undefined") _addPath = "0"; | ||
_addPath = _addPath.replace(/[a-zA-Z\[\]]+/g, "").replace(/(\d+)/g, function (a, b) { | ||
var addPath = ""; | ||
if (_addPath == "undefined") addPath = "0"; | ||
addPath = _addPath.replace(/[a-zA-Z\[\]]+/g, "").replace(/(\d+)/g, function (a, b) { | ||
return "panels[" + a + "]"; | ||
}); | ||
//_addPath = [].concat(_addPath.split(/[\.]/g)); | ||
var pane = getPanel(_addPath); | ||
console.log(pane); | ||
var pane = getPanel(addPath); | ||
var parent = getPanelParent(pane); | ||
if (parent.type == "stack") { | ||
// 부모패널로 ~ | ||
//console.log(addPath, _addPath); | ||
pane = parent; | ||
addPath = pane.panelPath; | ||
} | ||
var panelProcessor = { | ||
@@ -906,8 +928,8 @@ "stack": function stack(_pane, _addType, _panel) { | ||
"row-left": function rowLeft(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -922,8 +944,8 @@ panels: [] | ||
"row-right": function rowRight(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -938,8 +960,8 @@ panels: [] | ||
"column-top": function columnTop(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -954,8 +976,8 @@ panels: [] | ||
"column-bottom": function columnBottom(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -987,9 +1009,9 @@ panels: [] | ||
"row-left": function rowLeft(_pane, _panel, _panelIndex) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
_pane.panels.splice(_panelIndex, 0, _panel); | ||
arrangePanel(); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1004,9 +1026,9 @@ panels: [] | ||
"row-right": function rowRight(_pane, _panel, _panelIndex) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
_pane.panels.splice(_panelIndex + 1, 0, _panel); | ||
arrangePanel(); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1021,8 +1043,8 @@ panels: [] | ||
"column-top": function columnTop(_pane, _panel, _panelIndex) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1037,8 +1059,8 @@ panels: [] | ||
"column-bottom": function columnBottom(_pane, _panel, _panelIndex) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1069,8 +1091,8 @@ panels: [] | ||
"row-left": function rowLeft(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1085,8 +1107,8 @@ panels: [] | ||
"row-right": function rowRight(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1117,2 +1139,3 @@ panels: [] | ||
"panel": function panel(_pane, _addType, _panel) { | ||
// todo : 부모가 stack인지 체크 하자. | ||
var copyPanel = jQuery.extend({}, _pane), | ||
@@ -1122,3 +1145,3 @@ addProcessor = { | ||
// _pane stack으로 재구성 | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "stack", | ||
@@ -1132,8 +1155,8 @@ panels: [] | ||
"row-left": function rowLeft(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1148,8 +1171,8 @@ panels: [] | ||
"row-right": function rowRight(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1164,8 +1187,8 @@ panels: [] | ||
"column-top": function columnTop(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1180,8 +1203,8 @@ panels: [] | ||
"column-bottom": function columnBottom(_pane, _panel) { | ||
var parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
var parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
var parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1210,2 +1233,14 @@ panels: [] | ||
/** | ||
* @method ax5docker.movePanel | ||
* @param _panel | ||
* @param _movePath | ||
* @param _moveType | ||
* @returns {ax5docker} | ||
*/ | ||
this.movePanel = function (_panel, _movePath, _moveType) { | ||
return this; | ||
}; | ||
// 클래스 생성자 | ||
@@ -1212,0 +1247,0 @@ this.main = function () { |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util;e.addClass({className:"docker",version:"1.3.103"},function(){var e=function(){var e=this,n=this,t=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."}},this.xvar={},this.menu=null,this.panels=[],this.panelId=0,this.modules={},t=this.config;var r=function(){return e.panelId++},l={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},o=function(e,a){var n=[];return e&&"undefined"!=typeof e.panelPath&&n.push(e.panelPath),n.push("panels["+(a||0)+"]"),n.join(".")},i=function(n){var t=[],r=a.isArray(n)?[].concat(n):[].concat(n.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&t.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+t.join("")+";").call(e)}catch(l){return}},s=function(n,t){var r=[],l=a.isArray(n)?[].concat(n):[].concat(n.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(e,t)},d=function(e){var a=void 0,n=e.originalEvent?e.originalEvent:e;return a="changedTouches"in n?n.changedTouches[0]:n,{clientX:a.pageX,clientY:a.pageY}},p=function(n,r){var o=jQuery.extend(n.moduleState,{name:n.name}),i={$element:n.$item},d=void 0,p={init:function(){n.builded=!0,d=n.moduleName in e.modules&&"init"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.init(i,o)},active:function(){n.active=!0,n.$label.addClass("active"),n.$item.addClass("active");var a=n.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:n.$label.position().left},300),d=n.moduleName in e.modules&&"active"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.active(i,o),a=null},deactive:function(){n.active=!1,n.$label.removeClass("active"),n.$item.removeClass("active"),d=n.moduleName in e.modules&&"deactive"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.deactive(i,o)},destroy:function(){d=n.moduleName in e.modules&&"destroy"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.destroy(i,o),s(n.panelPath,null),y()}},c={panel:n,controlType:r},u=function(){p[r](),d=null,a.isFunction(t.control.after)&&t.control.after.call(c,c)};p[r]&&(a.isFunction(t.control.before)?t.control.before.call(c,c,function(){u()}):u())},c=function(){var l={stack:function(e,n,r,i){var s=void 0,d=-1;r.panelPath=o(n,i),s=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+r.panelPath+'" style="flex-grow: '+(r.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+t.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),e.append(s),a.isArray(r.panels)&&(r.panels.forEach(function(e,a){e.active&&(d=a)}),d===-1&&(d=0),r.panels[d].active=!0,r.panels.forEach(function(e,a){e.panelIndex=a,l[e.type](s,r,e,a)})),s=null,d=null},panel:function(e,a,n,l){var i=void 0;n.panelPath=o(a,l),n.$label=jQuery('<li data-ax5docker-pane-tab="'+l+'" data-ax5docker-path="'+n.panelPath+'"><div class="title">'+n.name+'</div><div class="close-icon">'+t.icons.close+"</div></li>"),n.$item||(n.$item=jQuery('<div data-ax5docker-pane-item="'+l+'" data-ax5docker-pane-id="'+r()+'" data-ax5docker-path="'+n.panelPath+'"></div>')),a&&"stack"==a.type?(n.active&&(n.builded||p(n,"init"),p(n,"active")),e.find("[data-ax5docker-pane-tabs]").append(n.$label),e.find("[data-ax5docker-pane-item-views]").append(n.$item)):(i=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+n.panelPath+'" style="flex-grow: '+(n.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+t.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),n.builded||p(n,"init"),p(n,"active"),i.find("[data-ax5docker-pane-tabs]").append(n.$label),i.find("[data-ax5docker-pane-item-views]").append(n.$item),e.append(i)),i=null},resizeHandle:function(e,a,n,t){var r=jQuery('<div data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+t+'"></div>');e.append(r),r=null},row:function(e,n,t,r){var i=void 0;if(t.panelPath=o(n,r),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(i),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(i,t,e,a),e.panelIndex=a,l[e.type](i,t,e,a)}),i=null},column:function(e,n,t,r){var i=void 0;if(t.panelPath=o(n,r),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(i),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(i,t,e,a),e.panelIndex=a,l[e.type](i,t,e,a)}),i=null}},s=jQuery('<div data-ax5docker-panes=""></div>');e.panels[0]&&l[e.panels[0].type](s,null,e.panels[0],0),e.$target.html(s),e.$target.off("click.ax5docker-pane").on("click.ax5docker-pane","[data-ax5docker-pane-tab] .close-icon",function(e){f($(this).parents("[data-ax5docker-pane-tab]")),a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tab]",function(e){var n=jQuery(this),t=i(n.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=n.attr("data-ax5docker-pane-tab");n.hasClass("active")||u(t,r),n=null,t=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tabs-more]",function(e){v($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),e.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize","[data-ax5docker-pane-tab]",function(e){x.on(this)}).on("mousedown.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){var t=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);n.xvar.mousePosition=d(e),n.xvar.resizerType=t[0],n.xvar.resizerPath=t[1],n.xvar.resizerIndex=t[2],n.xvar.resizer$dom=$(this),n.xvar.resizerParent$dom=n.xvar.resizer$dom.parent(),n.xvar.resizerPrevGrow=a.number(n.xvar.resizer$dom.prev().css("flex-grow")),n.xvar.resizerNextGrow=a.number(n.xvar.resizer$dom.next().css("flex-grow")),"row"==n.xvar.resizerType?n.xvar.resizerCanvasWidth=n.xvar.resizer$dom.prev().innerWidth()+n.xvar.resizer$dom.next().innerWidth()+n.xvar.resizer$dom.width():n.xvar.resizerCanvasHeight=n.xvar.resizer$dom.prev().innerHeight()+n.xvar.resizer$dom.next().innerHeight()+n.xvar.resizer$dom.height(),h.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){return a.stopEvent(e),!1}),g(),s=null},u=function(a,n){for(var t=a.panels[n],r=0,l=a.panels.length;r<l;r++)a.panels[r].active&&p(a.panels[r],"deactive");return t.builded||p(t,"init"),p(t,"active"),a=null,n=null,t=null,e},f=function(a){var n=jQuery(a),t=n.attr("data-ax5docker-path"),r=i(t);return p(r,"destroy"),n=null,t=null,r=null,e},v=function(n,t){var r=jQuery(n),l=r.attr("data-ax5docker-path"),o=i(l);if(!e.menu)throw console.log(o.panels),"'ax5ui-menu' is required to implement the function.";var s=a.map(o.panels,function(e){return{label:this.name,index:e,panePath:l}});return e.menu.setConfig({items:s,onClick:function(){u(i(this.panePath),this.index)}}),e.menu.popup(t),r=null,l=null,o=null,e},h={on:function(t){var r=$(t);r.offset().left,e.$target.offset().left;jQuery(document.body).on("mousemove.ax5docker-"+e.instanceId,function(e){var t=d(e),r=void 0;n.xvar.resizerLived?"row"==n.xvar.resizerType?(n.xvar.__da=t.clientX-n.xvar.mousePosition.clientX,r=a.number(2*n.xvar.__da/n.xvar.resizerCanvasWidth,{round:6}),n.xvar.resizer$dom.prev().css({"flex-grow":n.xvar.resizerPrevGrow+r}),n.xvar.resizer$dom.next().css({"flex-grow":n.xvar.resizerNextGrow-r})):(n.xvar.__da=t.clientY-n.xvar.mousePosition.clientY,r=a.number(2*n.xvar.__da/n.xvar.resizerCanvasHeight,{round:6}),n.xvar.resizer$dom.prev().css({"flex-grow":n.xvar.resizerPrevGrow+r}),n.xvar.resizer$dom.next().css({"flex-grow":n.xvar.resizerNextGrow-r})):n.xvar.resizerLived=!0,t=null,r=null}).on("mouseup.ax5docker-"+e.instanceId,function(e){h.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+e.instanceId,function(e){h.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(n.xvar.resizerLived=!1,"undefined"==typeof e.xvar.__da);else{var t=n.xvar.resizer$dom.prev(),r=n.xvar.resizer$dom.next(),l=i(t.attr("data-ax5docker-path")),o=i(r.attr("data-ax5docker-path"));l.flexGrow=a.number(t.css("flex-grow")),o.flexGrow=a.number(r.css("flex-grow")),t=null,r=null,l=null,o=null}jQuery(document.body).off("mousemove.ax5docker-"+e.instanceId).off("mouseup.ax5docker-"+e.instanceId).off("mouseleave.ax5docker-"+e.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},x={on:function(){e.panels[0]&&e.panels[0].panels&&e.panels[0].panels.length&&(e.xvar.dragger={target:null,dragOverVertical:null,dragOverHorizontal:null},e.$target.on("dragover.ax5docker-"+e.instanceId,"[data-ax5docker-path]",function(e){x.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}).on("dragend.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}))},dragover:function(a,n){var t=jQuery(a);null!=e.xvar.dragger.target&&e.xvar.dragger.target.get(0)==t.get(0)||(e.xvar.dragger.target&&e.xvar.dragger.target.removeAttr("data-dropper"),e.xvar.dragger.target=t,e.xvar.dragger.dragOverVertical=null,e.xvar.dragger.dragOverHorizontal=null);var r={};r=t.offset(),r.width=t.width(),r.height=t.height();var l=d(n),o=void 0,i=void 0;if(t.attr("data-ax5docker-pane-tab")){var s=r.width/2;if(r.left<=l.clientX&&r.left+s>=l.clientX?i="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(i="right"),e.xvar.dragger.dragOverHorizontal!=i&&"undefined"!=typeof i){e.xvar.dragger.dragOverHorizontal=i;var p={left:function(e){e.attr("data-dropper","left")},right:function(e){e.attr("data-dropper","right")}};p[e.xvar.dragger.dragOverHorizontal](e.xvar.dragger.target)}}else if(t.attr("data-ax5docker-pane-item")){var c=r.height/3,u=r.width/3;if(r.top<=l.clientY&&r.top+c>=l.clientY?o="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?o="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+u>=l.clientX?i="left":r.left+u<=l.clientX&&r.left+2*u>=l.clientX?i="center":r.left+2*u<=l.clientX&&r.left+3*u>=l.clientX&&(i="right"),e.xvar.dragger.dragOverVertical!=o||e.xvar.dragger.dragOverHorizontal!=i){e.xvar.dragger.dragOverVertical=o,e.xvar.dragger.dragOverHorizontal=i;var p={"left-top":function(e){e.attr("data-dropper","left")},"right-top":function(e){e.attr("data-dropper","right")},"center-top":function(e){e.attr("data-dropper","top")},"left-middle":function(e){e.attr("data-dropper","left")},"right-middle":function(e){e.attr("data-dropper","right")},"center-middle":function(e){e.attr("data-dropper","center")},"left-bottom":function(e){e.attr("data-dropper","left")},"right-bottom":function(e){e.attr("data-dropper","right")},"center-bottom":function(e){e.attr("data-dropper","bottom")}};p[e.xvar.dragger.dragOverHorizontal+"-"+e.xvar.dragger.dragOverVertical](e.xvar.dragger.target)}}},off:function(){e.$target.off("dragover.ax5docker-"+e.instanceId).off("drop.ax5docker-"+e.instanceId).off("dragend.ax5docker-"+e.instanceId),e.xvar.dragger.target.removeAttr("data-dropper")}},m=ax5.util.debounce(function(e){e()},t.animateTime),g=function(){m(function(){this.$target.find("[data-ax5docker-pane-tabs]").each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(e))},y=function(){var n={stack:function(e){if(!a.isArray(e.panels))return!1;var t={type:"stack",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},panel:function(e){return e},row:function(e){if(!a.isArray(e.panels))return!1;var t={type:"row",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},column:function(e){if(!a.isArray(e.panels))return!1;var t={type:"column",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)}};e.panels[0]?e.panels[0]=n[e.panels[0].type](e.panels[0]):e.panels=[],c()};this.init=function(e){return t=jQuery.extend(!0,{},t,e),t.target?(this.$target=jQuery(t.target),this.panels=t.panels||[],this.onStateChanged=t.onStateChanged,this.onClick=t.onClick,this.onLoad=t.onLoad,this.onDataChanged=t.onDataChanged,ax5.ui.menu&&(this.menu=new ax5.ui.menu({theme:"default",position:"absolute",icons:{arrow:"▸"}})),void jQuery(window).bind("resize.ax5docker-"+this.id,function(){g()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],c(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return c(),this},this.addPanel=function(e,a,n,t){"undefined"==e&&(e="0"),e=e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"});var r=i(e);console.log(r);var l={stack:function(a,n,t){var r=jQuery.extend({},a),l={stack:function(e,a){e.panels.push(a),y()},"row-left":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"row-right":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"row",panels:[]}),a.panels.push(r),a.panels.push(t),y())},"column-top":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"column-bottom":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"column",panels:[]}),a.panels.push(r),a.panels.push(t),y())}};n in l&&l[n].call(this,a,t),r=null,l=null},row:function(a,n,t,r){var l=jQuery.extend({},a),o={stack:function(e,a){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,n,a)},"row-left":function(a,n,t){var r=e.substr(0,e.lastIndexOf(".")),o=i(r);"row"==o.type?(a.panels.splice(t,0,n),y()):(a=s(e,{type:"row",panels:[]}),a.panels.push(n),a.panels.push(l),y())},"row-right":function(a,n,t){var r=e.substr(0,e.lastIndexOf(".")),o=i(r);"row"==o.type?(a.panels.splice(t+1,0,n),y()):(a=s(e,{type:"row",panels:[]}),a.panels.push(l),a.panels.push(n),y())},"column-top":function(a,t,r){var o=e.substr(0,e.lastIndexOf(".")),d=i(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=s(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(l),y())},"column-bottom":function(a,t,r){var o=e.substr(0,e.lastIndexOf(".")),d=i(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=s(e,{type:"column",panels:[]}),a.panels.push(l),a.panels.push(t),y())}};n in o&&o[n].call(this,a,t,r),o=null,l=null},column:function(a,n,t,r){var l=jQuery.extend({},a),o={stack:function(e,a){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,n,a)},"row-left":function(a,t){var r=e.substr(0,e.lastIndexOf(".")),o=i(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(l),y())},"row-right":function(a,t){var r=e.substr(0,e.lastIndexOf(".")),o=i(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"row",panels:[]}),a.panels.push(l),a.panels.push(t),y())},"column-top":function(e,a){e.panels.splice(r,0,a),y()},"column-bottom":function(e,a){e.panels.splice(r+1,0,a),y()}};n in o&&o[n].call(this,a,t),o=null,l=null},panel:function(a,n,t){var r=jQuery.extend({},a),l={stack:function(a,n){a=s(e,{type:"stack",panels:[]}),a.panels.push(r),a.panels.push(n),y()},"row-left":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"row-right":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"row",panels:[]}),a.panels.push(r),a.panels.push(t),y())},"column-top":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"column-bottom":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=i(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=s(e,{type:"column",panels:[]}),a.panels.push(r),a.panels.push(t),y())}};n in l&&l[n].call(this,a,t),r=null,l=null}};return l[r.type].call(this,r,a,n,t),this},this.main=function(){arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)};return e}())}(),function(){var e=ax5.ui.docker;e.tmpl={get:function(a,n,t){return ax5.mustache.render(e.tmpl[a].call(this,t),n)}}}(); | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util;e.addClass({className:"docker",version:"1.3.104"},function(){var e=function(){var e=this,t=this,n=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."}},this.xvar={},this.menu=null,this.panels=[],this.panelId=0,this.modules={},n=this.config;var r=function(){return e.panelId++},l={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},o=function(e,a){var t=[];return e&&"undefined"!=typeof e.panelPath&&t.push(e.panelPath),t.push("panels["+(a||0)+"]"),t.join(".")},i=function(t){var n=[],r=a.isArray(t)?[].concat(t):[].concat(t.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&n.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+n.join("")+";").call(e)}catch(l){return}},s=function(a){var t=a.panelPath.substr(0,a.panelPath.lastIndexOf("."));try{return Function("","return this."+t+";").call(e)}catch(n){return void console.log(n)}},d=function(t,n){var r=[],l=a.isArray(t)?[].concat(t):[].concat(t.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(e,n)},p=function(e){var a=void 0,t=e.originalEvent?e.originalEvent:e;return a="changedTouches"in t?t.changedTouches[0]:t,{clientX:a.pageX,clientY:a.pageY}},c=function(t,r){var o=jQuery.extend(t.moduleState,{name:t.name}),i={$element:t.$item},s=void 0,p={init:function(){t.builded=!0,s=t.moduleName in e.modules&&"init"in e.modules[t.moduleName]?e.modules[t.moduleName]:l,s.init(i,o)},active:function(){t.active=!0,t.$label.addClass("active"),t.$item.addClass("active");var a=t.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:t.$label.position().left},300),s=t.moduleName in e.modules&&"active"in e.modules[t.moduleName]?e.modules[t.moduleName]:l,s.active(i,o),a=null},deactive:function(){t.active=!1,t.$label.removeClass("active"),t.$item.removeClass("active"),s=t.moduleName in e.modules&&"deactive"in e.modules[t.moduleName]?e.modules[t.moduleName]:l,s.deactive(i,o)},destroy:function(){s=t.moduleName in e.modules&&"destroy"in e.modules[t.moduleName]?e.modules[t.moduleName]:l,s.destroy(i,o),d(t.panelPath,null),k()}},c={panel:t,controlType:r},u=function(){p[r](),s=null,a.isFunction(n.control.after)&&n.control.after.call(c,c)};p[r]&&(a.isFunction(n.control.before)?n.control.before.call(c,c,function(){u()}):u())},u=function(){var l={stack:function(e,t,r,i){var s=void 0,d=-1;r.panelPath=o(t,i),s=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+r.panelPath+'" style="flex-grow: '+(r.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+n.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),e.append(s),a.isArray(r.panels)&&(r.panels.forEach(function(e,a){e.active&&(d=a)}),d===-1&&(d=0),r.panels[d].active=!0,r.panels.forEach(function(e,a){e.panelIndex=a,l[e.type](s,r,e,a)})),s=null,d=null},panel:function(e,a,t,l){var i=void 0;t.panelPath=o(a,l),t.$label=jQuery('<li data-ax5docker-pane-tab="'+l+'" data-ax5docker-path="'+t.panelPath+'"><div class="title">'+t.name+'</div><div class="close-icon">'+n.icons.close+"</div></li>"),t.$item||(t.$item=jQuery('<div data-ax5docker-pane-item="'+l+'" data-ax5docker-pane-id="'+r()+'" data-ax5docker-path="'+t.panelPath+'"></div>')),a&&"stack"==a.type?(t.active&&(t.builded||c(t,"init"),c(t,"active")),e.find("[data-ax5docker-pane-tabs]").append(t.$label),e.find("[data-ax5docker-pane-item-views]").append(t.$item)):(i=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+n.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),t.builded||c(t,"init"),c(t,"active"),i.find("[data-ax5docker-pane-tabs]").append(t.$label),i.find("[data-ax5docker-pane-item-views]").append(t.$item),e.append(i)),i=null},resizeHandle:function(e,a,t,n){var r=jQuery('<div data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+n+'"></div>');e.append(r),r=null},row:function(e,t,n,r){var i=void 0;if(n.panelPath=o(t,r),t&&"stack"==t.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-path="'+n.panelPath+'" style="flex-grow: '+(n.flexGrow||1)+';"></div>'),e.append(i),a.isArray(n.panels)&&n.panels.forEach(function(e,a){a>0&&l.resizeHandle(i,n,e,a),e.panelIndex=a,l[e.type](i,n,e,a)}),i=null},column:function(e,t,n,r){var i=void 0;if(n.panelPath=o(t,r),t&&"stack"==t.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-path="'+n.panelPath+'" style="flex-grow: '+(n.flexGrow||1)+';"></div>'),e.append(i),a.isArray(n.panels)&&n.panels.forEach(function(e,a){a>0&&l.resizeHandle(i,n,e,a),e.panelIndex=a,l[e.type](i,n,e,a)}),i=null}},s=jQuery('<div data-ax5docker-panes=""></div>');e.panels[0]&&l[e.panels[0].type](s,null,e.panels[0],0),e.$target.html(s),e.$target.off("click.ax5docker-pane").on("click.ax5docker-pane","[data-ax5docker-pane-tab] .close-icon",function(e){v($(this).parents("[data-ax5docker-pane-tab]")),a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tab]",function(e){var t=jQuery(this),n=i(t.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=t.attr("data-ax5docker-pane-tab");t.hasClass("active")||f(n,r),t=null,n=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tabs-more]",function(e){h($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),e.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize","[data-ax5docker-pane-tab]",function(e){m.on(this)}).on("mousedown.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){var n=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);t.xvar.mousePosition=p(e),t.xvar.resizerType=n[0],t.xvar.resizerPath=n[1],t.xvar.resizerIndex=n[2],t.xvar.resizer$dom=$(this),t.xvar.resizerParent$dom=t.xvar.resizer$dom.parent(),t.xvar.resizerPrevGrow=a.number(t.xvar.resizer$dom.prev().css("flex-grow")),t.xvar.resizerNextGrow=a.number(t.xvar.resizer$dom.next().css("flex-grow")),"row"==t.xvar.resizerType?t.xvar.resizerCanvasWidth=t.xvar.resizer$dom.prev().innerWidth()+t.xvar.resizer$dom.next().innerWidth()+t.xvar.resizer$dom.width():t.xvar.resizerCanvasHeight=t.xvar.resizer$dom.prev().innerHeight()+t.xvar.resizer$dom.next().innerHeight()+t.xvar.resizer$dom.height(),x.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){return a.stopEvent(e),!1}),y(),s=null},f=function(a,t){for(var n=a.panels[t],r=0,l=a.panels.length;r<l;r++)a.panels[r].active&&c(a.panels[r],"deactive");return n.builded||c(n,"init"),c(n,"active"),a=null,t=null,n=null,e},v=function(a){var t=jQuery(a),n=t.attr("data-ax5docker-path"),r=i(n);return c(r,"destroy"),t=null,n=null,r=null,e},h=function(t,n){var r=jQuery(t),l=r.attr("data-ax5docker-path"),o=i(l);if(!e.menu)throw console.log(o.panels),"'ax5ui-menu' is required to implement the function.";var s=a.map(o.panels,function(e){return{label:this.name,index:e,panePath:l}});return e.menu.setConfig({items:s,onClick:function(){f(i(this.panePath),this.index)}}),e.menu.popup(n),r=null,l=null,o=null,e},x={on:function(n){var r=$(n);r.offset().left,e.$target.offset().left;jQuery(document.body).on("mousemove.ax5docker-"+e.instanceId,function(e){var n=p(e),r=void 0;t.xvar.resizerLived?"row"==t.xvar.resizerType?(t.xvar.__da=n.clientX-t.xvar.mousePosition.clientX,r=a.number(2*t.xvar.__da/t.xvar.resizerCanvasWidth,{round:6}),t.xvar.resizer$dom.prev().css({"flex-grow":t.xvar.resizerPrevGrow+r}),t.xvar.resizer$dom.next().css({"flex-grow":t.xvar.resizerNextGrow-r})):(t.xvar.__da=n.clientY-t.xvar.mousePosition.clientY,r=a.number(2*t.xvar.__da/t.xvar.resizerCanvasHeight,{round:6}),t.xvar.resizer$dom.prev().css({"flex-grow":t.xvar.resizerPrevGrow+r}),t.xvar.resizer$dom.next().css({"flex-grow":t.xvar.resizerNextGrow-r})):t.xvar.resizerLived=!0,n=null,r=null}).on("mouseup.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(t.xvar.resizerLived=!1,"undefined"==typeof e.xvar.__da);else{var n=t.xvar.resizer$dom.prev(),r=t.xvar.resizer$dom.next(),l=i(n.attr("data-ax5docker-path")),o=i(r.attr("data-ax5docker-path"));l.flexGrow=a.number(n.css("flex-grow")),o.flexGrow=a.number(r.css("flex-grow")),n=null,r=null,l=null,o=null}jQuery(document.body).off("mousemove.ax5docker-"+e.instanceId).off("mouseup.ax5docker-"+e.instanceId).off("mouseleave.ax5docker-"+e.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},m={on:function(){e.panels[0]&&e.panels[0].panels&&e.panels[0].panels.length&&(e.xvar.dragger={target:null,dragOverVertical:null,dragOverHorizontal:null},e.$target.on("dragover.ax5docker-"+e.instanceId,"[data-ax5docker-path]",function(e){m.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+e.instanceId,function(e){m.off("drop"),a.stopEvent(e)}).on("dragend.ax5docker-"+e.instanceId,function(e){m.off(),a.stopEvent(e)}))},dragover:function(a,t){var n=jQuery(a);null!=e.xvar.dragger.target&&e.xvar.dragger.target.get(0)==n.get(0)||(e.xvar.dragger.target&&e.xvar.dragger.target.removeAttr("data-dropper"),e.xvar.dragger.target=n,e.xvar.dragger.dragOverVertical=null,e.xvar.dragger.dragOverHorizontal=null);var r={};r=n.offset(),r.width=n.width(),r.height=n.height();var l=p(t),o=void 0,i=void 0;if(n.attr("data-ax5docker-pane-tab")){var s=r.width/2;if(r.left<=l.clientX&&r.left+s>=l.clientX?i="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(i="right"),e.xvar.dragger.dragOverHorizontal!=i&&"undefined"!=typeof i){e.xvar.dragger.dragOverHorizontal=i;var d={left:function(e){e.attr("data-dropper","left")},right:function(e){e.attr("data-dropper","right")}};d[e.xvar.dragger.dragOverHorizontal](e.xvar.dragger.target)}}else if(n.attr("data-ax5docker-pane-item")){var c=r.height/3,u=r.width/3;if(r.top<=l.clientY&&r.top+c>=l.clientY?o="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?o="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+u>=l.clientX?i="left":r.left+u<=l.clientX&&r.left+2*u>=l.clientX?i="center":r.left+2*u<=l.clientX&&r.left+3*u>=l.clientX&&(i="right"),e.xvar.dragger.dragOverVertical!=o||e.xvar.dragger.dragOverHorizontal!=i){e.xvar.dragger.dragOverVertical=o,e.xvar.dragger.dragOverHorizontal=i;var d={"left-top":function(e){e.attr("data-dropper","left")},"right-top":function(e){e.attr("data-dropper","right")},"center-top":function(e){e.attr("data-dropper","top")},"left-middle":function(e){e.attr("data-dropper","left")},"right-middle":function(e){e.attr("data-dropper","right")},"center-middle":function(e){e.attr("data-dropper","center")},"left-bottom":function(e){e.attr("data-dropper","left")},"right-bottom":function(e){e.attr("data-dropper","right")},"center-bottom":function(e){e.attr("data-dropper","bottom")}};d[e.xvar.dragger.dragOverHorizontal+"-"+e.xvar.dragger.dragOverVertical](e.xvar.dragger.target)}}},off:function(a){a&&console.log(e.xvar.dragger),e.$target.off("dragover.ax5docker-"+e.instanceId).off("drop.ax5docker-"+e.instanceId).off("dragend.ax5docker-"+e.instanceId),e.xvar.dragger.target.removeAttr("data-dropper")}},g=ax5.util.debounce(function(e){e()},n.animateTime),y=function(){g(function(){this.$target.find("[data-ax5docker-pane-tabs]").each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(e))},k=function(){var t={stack:function(e){if(!a.isArray(e.panels))return!1;var n={type:"stack",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=t[e.type](e);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},panel:function(e){return e},row:function(e){if(!a.isArray(e.panels))return!1;var n={type:"row",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=t[e.type](e);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},column:function(e){if(!a.isArray(e.panels))return!1;var n={type:"column",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=t[e.type](e);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)}};e.panels[0]?e.panels[0]=t[e.panels[0].type](e.panels[0]):e.panels=[],u()};this.init=function(e){return n=jQuery.extend(!0,{},n,e),n.target?(this.$target=jQuery(n.target),this.panels=n.panels||[],this.onStateChanged=n.onStateChanged,this.onClick=n.onClick,this.onLoad=n.onLoad,this.onDataChanged=n.onDataChanged,ax5.ui.menu&&(this.menu=new ax5.ui.menu({theme:"default",position:"absolute",icons:{arrow:"▸"}})),void jQuery(window).bind("resize.ax5docker-"+this.id,function(){y()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],u(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return u(),this},this.addPanel=function(e,a,t,n){var r="";"undefined"==e&&(r="0"),r=e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"});var l=i(r),o=s(l);"stack"==o.type&&(l=o,r=l.panelPath);var p={stack:function(e,a,t){var n=jQuery.extend({},e),l={stack:function(e,a){e.panels.push(a),k()},"row-left":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(n),k())},"row-right":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(t),k())},"column-top":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(n),k())},"column-bottom":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(t),k())}};a in l&&l[a].call(this,e,t),n=null,l=null},row:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,a,t){var n=r.substr(0,r.lastIndexOf(".")),o=i(n);o&&"row"==o.type?(e.panels.splice(t,0,a),k()):(e=d(r,{type:"row",panels:[]}),e.panels.push(a),e.panels.push(l),k())},"row-right":function(e,a,t){var n=r.substr(0,r.lastIndexOf(".")),o=i(n);o&&"row"==o.type?(e.panels.splice(t+1,0,a),k()):(e=d(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(a),k())},"column-top":function(e,t,n){var o=r.substr(0,r.lastIndexOf(".")),s=i(o);s&&"column"==s.type?this.addPanel(s.panelPath,a,t,e.panelIndex):(e=d(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(l),k())},"column-bottom":function(e,t,n){var o=r.substr(0,r.lastIndexOf(".")),s=i(o);s&&"column"==s.type?this.addPanel(s.panelPath,a,t,e.panelIndex):(e=d(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(t),k())}};a in o&&o[a].call(this,e,t,n),o=null,l=null},column:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=i(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(l),k())},"row-right":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=i(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(t),k())},"column-top":function(e,a){e.panels.splice(n,0,a),k()},"column-bottom":function(e,a){e.panels.splice(n+1,0,a),k()}};a in o&&o[a].call(this,e,t),o=null,l=null},panel:function(e,a,t){var n=jQuery.extend({},e),l={stack:function(e,a){e=d(r,{type:"stack",panels:[]}),e.panels.push(n),e.panels.push(a),k()},"row-left":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(n),k())},"row-right":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(t),k())},"column-top":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(n),k())},"column-bottom":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=i(l);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=d(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(t),k())}};a in l&&l[a].call(this,e,t),n=null,l=null}};return p[l.type].call(this,l,a,t,n),this},this.movePanel=function(e,a,t){return this},this.main=function(){arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)};return e}())}(),function(){var e=ax5.ui.docker;e.tmpl={get:function(a,t,n){return ax5.mustache.render(e.tmpl[a].call(this,n),t)}}}(); |
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.3.103", | ||
"version": "1.3.104", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -113,2 +113,16 @@ /* | ||
/** | ||
* 패널을 이용하여 패널의 부모 패널을 가져옵니다 | ||
* @param _panel | ||
*/ | ||
const getPanelParent = (_panel) => { | ||
let _path = _panel.panelPath.substr(0, _panel.panelPath.lastIndexOf(".")); | ||
try { | ||
return (Function("", "return this." + _path + ";")).call(this); | ||
} catch (e) { | ||
console.log(e); | ||
return; | ||
} | ||
}; | ||
/** | ||
* 패널패스를 이용하여 패널오브젝트에 값을 부여합니다. | ||
@@ -599,3 +613,3 @@ * @param _panelPath | ||
.on("drop.ax5docker-" + this.instanceId, function (e) { | ||
panelTabDragEvent.off(); | ||
panelTabDragEvent.off("drop"); | ||
U.stopEvent(e); | ||
@@ -613,3 +627,3 @@ }) | ||
if(this.xvar.dragger.target) this.xvar.dragger.target.removeAttr("data-dropper"); | ||
if (this.xvar.dragger.target) this.xvar.dragger.target.removeAttr("data-dropper"); | ||
@@ -716,3 +730,10 @@ this.xvar.dragger.target = $dragoverDom; | ||
}, | ||
"off": () => { | ||
"off": (isDrop) => { | ||
if(isDrop){ | ||
console.log(this.xvar.dragger); | ||
} | ||
this.$target | ||
@@ -934,4 +955,5 @@ .off("dragover.ax5docker-" + this.instanceId) | ||
this.addPanel = function (_addPath, _addType, _panel, _panelIndex) { | ||
if (_addPath == "undefined") _addPath = "0"; | ||
_addPath = _addPath | ||
let addPath = ""; | ||
if (_addPath == "undefined") addPath = "0"; | ||
addPath = _addPath | ||
.replace(/[a-zA-Z\[\]]+/g, "") | ||
@@ -942,7 +964,10 @@ .replace(/(\d+)/g, function (a, b) { | ||
//_addPath = [].concat(_addPath.split(/[\.]/g)); | ||
let pane = getPanel(_addPath); | ||
console.log(pane); | ||
let pane = getPanel(addPath); | ||
let parent = getPanelParent(pane); | ||
if (parent.type == "stack") { | ||
// 부모패널로 ~ | ||
//console.log(addPath, _addPath); | ||
pane = parent; | ||
addPath = pane.panelPath; | ||
} | ||
let panelProcessor = { | ||
@@ -957,8 +982,8 @@ "stack"(_pane, _addType, _panel){ | ||
"row-left"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -973,8 +998,8 @@ panels: [] | ||
"row-right"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -989,8 +1014,8 @@ panels: [] | ||
"column-top"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1005,8 +1030,8 @@ panels: [] | ||
"column-bottom"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1038,9 +1063,9 @@ panels: [] | ||
"row-left"(_pane, _panel, _panelIndex){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
_pane.panels.splice(_panelIndex, 0, _panel); | ||
arrangePanel(); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1055,9 +1080,9 @@ panels: [] | ||
"row-right"(_pane, _panel, _panelIndex){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
_pane.panels.splice(_panelIndex + 1, 0, _panel); | ||
arrangePanel(); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1072,8 +1097,8 @@ panels: [] | ||
"column-top"(_pane, _panel, _panelIndex){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1088,8 +1113,8 @@ panels: [] | ||
"column-bottom"(_pane, _panel, _panelIndex){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1120,8 +1145,8 @@ panels: [] | ||
"row-left"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1136,8 +1161,8 @@ panels: [] | ||
"row-right"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1168,2 +1193,3 @@ panels: [] | ||
"panel"(_pane, _addType, _panel){ | ||
// todo : 부모가 stack인지 체크 하자. | ||
let copyPanel = jQuery.extend({}, _pane), | ||
@@ -1173,3 +1199,3 @@ addProcessor = { | ||
// _pane stack으로 재구성 | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "stack", | ||
@@ -1183,8 +1209,8 @@ panels: [] | ||
"row-left"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1199,8 +1225,8 @@ panels: [] | ||
"row-right"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "row") { | ||
if (parentPane && parentPane.type == "row") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "row", | ||
@@ -1215,8 +1241,8 @@ panels: [] | ||
"column-top"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1231,8 +1257,8 @@ panels: [] | ||
"column-bottom"(_pane, _panel){ | ||
let parentPath = _addPath.substr(0, _addPath.lastIndexOf(".")); | ||
let parentPath = addPath.substr(0, addPath.lastIndexOf(".")); | ||
let parentPane = getPanel(parentPath); | ||
if (parentPane.type == "column") { | ||
if (parentPane && parentPane.type == "column") { | ||
this.addPanel(parentPane.panelPath, _addType, _panel, _pane.panelIndex); | ||
} else { | ||
_pane = setPanel(_addPath, { | ||
_pane = setPanel(addPath, { | ||
type: "column", | ||
@@ -1250,3 +1276,2 @@ panels: [] | ||
addProcessor[_addType].call(this, _pane, _panel); | ||
} | ||
@@ -1263,2 +1288,15 @@ | ||
/** | ||
* @method ax5docker.movePanel | ||
* @param _panel | ||
* @param _movePath | ||
* @param _moveType | ||
* @returns {ax5docker} | ||
*/ | ||
this.movePanel = function (_panel, _movePath, _moveType) { | ||
return this; | ||
}; | ||
// 클래스 생성자 | ||
@@ -1265,0 +1303,0 @@ this.main = (function () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2420
263264