ax5ui-docker
Advanced tools
Comparing version 1.3.92 to 1.3.93
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.3.92", | ||
"version": "1.3.93", | ||
"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.92" | ||
version: "1.3.93" | ||
}, function () { | ||
@@ -548,3 +548,3 @@ | ||
_this.xvar.drager = { | ||
_this.xvar.dragger = { | ||
target: null, | ||
@@ -572,6 +572,9 @@ dragOverVertical: null, | ||
var $dragoverDom = jQuery(dragoverDom); | ||
if (_this.xvar.drager.target == null || _this.xvar.drager.target.get(0) != $dragoverDom.get(0)) { | ||
_this.xvar.drager.target = $dragoverDom; | ||
_this.xvar.drager.dragOverVertical = null; | ||
_this.xvar.drager.dragOverHorizontal = null; | ||
if (_this.xvar.dragger.target == null || _this.xvar.dragger.target.get(0) != $dragoverDom.get(0)) { | ||
if (_this.xvar.dragger.target) _this.xvar.dragger.target.removeAttr("data-dropper"); | ||
_this.xvar.dragger.target = $dragoverDom; | ||
_this.xvar.dragger.dragOverVertical = null; | ||
_this.xvar.dragger.dragOverHorizontal = null; | ||
} | ||
@@ -588,3 +591,24 @@ | ||
dragOverHorizontal = void 0; | ||
if ($dragoverDom.attr("data-ax5docker-pane-tab")) {} else if ($dragoverDom.attr("data-ax5docker-pane-item")) { | ||
if ($dragoverDom.attr("data-ax5docker-pane-tab")) { | ||
var halfWidth = box.width / 2; | ||
if (box.left <= mouse.clientX && box.left + halfWidth >= mouse.clientX) { | ||
dragOverHorizontal = "left"; | ||
} else if (box.left + halfWidth <= mouse.clientX && box.left + halfWidth * 2 >= mouse.clientX) { | ||
dragOverHorizontal = "right"; | ||
} | ||
if (_this.xvar.dragger.dragOverHorizontal != dragOverHorizontal && typeof dragOverHorizontal != "undefined") { | ||
_this.xvar.dragger.dragOverHorizontal = dragOverHorizontal; | ||
var draggerProcessor = { | ||
"left": function left($target) { | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right": function right($target) { | ||
$target.attr("data-dropper", "right"); | ||
} | ||
}; | ||
draggerProcessor[_this.xvar.dragger.dragOverHorizontal](_this.xvar.dragger.target); | ||
} | ||
} else if ($dragoverDom.attr("data-ax5docker-pane-item")) { | ||
// panel dragover 포지션 구하기 | ||
@@ -609,14 +633,45 @@ var threeQuarterHeight = box.height / 3; | ||
} | ||
} | ||
if (_this.xvar.drager.dragOverVertical != dragOverVertical || _this.xvar.drager.dragOverHorizontal != dragOverHorizontal) { | ||
_this.xvar.drager.dragOverVertical = dragOverVertical; | ||
_this.xvar.drager.dragOverHorizontal = dragOverHorizontal; | ||
console.log(_this.xvar.drager); | ||
if (_this.xvar.dragger.dragOverVertical != dragOverVertical || _this.xvar.dragger.dragOverHorizontal != dragOverHorizontal) { | ||
_this.xvar.dragger.dragOverVertical = dragOverVertical; | ||
_this.xvar.dragger.dragOverHorizontal = dragOverHorizontal; | ||
var draggerProcessor = { | ||
"left-top": function leftTop($target) { | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right-top": function rightTop($target) { | ||
$target.attr("data-dropper", "right"); | ||
}, | ||
"center-top": function centerTop($target) { | ||
$target.attr("data-dropper", "top"); | ||
}, | ||
"left-middle": function leftMiddle($target) { | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right-middle": function rightMiddle($target) { | ||
$target.attr("data-dropper", "right"); | ||
}, | ||
"center-middle": function centerMiddle($target) { | ||
$target.attr("data-dropper", "center"); | ||
}, | ||
"left-bottom": function leftBottom($target) { | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right-bottom": function rightBottom($target) { | ||
$target.attr("data-dropper", "right"); | ||
}, | ||
"center-bottom": function centerBottom($target) { | ||
$target.attr("data-dropper", "bottom"); | ||
} | ||
}; | ||
draggerProcessor[_this.xvar.dragger.dragOverHorizontal + "-" + _this.xvar.dragger.dragOverVertical](_this.xvar.dragger.target); | ||
} | ||
} | ||
//console.log(box, mouse); | ||
}, | ||
"off": function off() { | ||
_this.$target.off("dragover.ax5docker-" + _this.instanceId).off("drop.ax5docker-" + _this.instanceId).off("dragend.ax5docker-" + _this.instanceId); | ||
_this.xvar.dragger.target.removeAttr("data-dropper"); | ||
} | ||
@@ -623,0 +678,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util;e.addClass({className:"docker",version:"1.3.92"},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(".")},s=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}},i=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}),s={$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(s,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(s,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(s,o)},destroy:function(){d=n.moduleName in e.modules&&"destroy"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.destroy(s,o),i(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,s){var i=void 0,d=-1;r.panelPath=o(n,s),i=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(i),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](i,r,e,a)})),i=null,d=null},panel:function(e,a,n,l){var s=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)):(s=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"),s.find("[data-ax5docker-pane-tabs]").append(n.$label),s.find("[data-ax5docker-pane-item-views]").append(n.$item),e.append(s)),s=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 s=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.";s=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(s),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(s,t,e,a),e.panelIndex=a,l[e.type](s,t,e,a)}),s=null},column:function(e,n,t,r){var s=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.";s=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(s),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(s,t,e,a),e.panelIndex=a,l[e.type](s,t,e,a)}),s=null}},i=jQuery('<div data-ax5docker-panes=""></div>');e.panels[0]&&l[e.panels[0].type](i,null,e.panels[0],0),e.$target.html(i),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=s(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){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){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(),v.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){return a.stopEvent(e),!1}),g(),i=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=s(t);return p(r,"destroy"),n=null,t=null,r=null,e},h=function(n,t){var r=jQuery(n),l=r.attr("data-ax5docker-path"),o=s(l);if(!e.menu)throw console.log(o.panels),"'ax5ui-menu' is required to implement the function.";var i=a.map(o.panels,function(e){return{label:this.name,index:e,panePath:l}});return e.menu.setConfig({items:i,onClick:function(){u(s(this.panePath),this.index)}}),e.menu.popup(t),r=null,l=null,o=null,e},v={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){v.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+e.instanceId,function(e){v.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=s(t.attr("data-ax5docker-path")),o=s(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.drager={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.drager.target&&e.xvar.drager.target.get(0)==t.get(0)||(e.xvar.drager.target=t,e.xvar.drager.dragOverVertical=null,e.xvar.drager.dragOverHorizontal=null);var r={};r=t.offset(),r.width=t.width(),r.height=t.height();var l=d(n),o=void 0,s=void 0;if(t.attr("data-ax5docker-pane-tab"));else if(t.attr("data-ax5docker-pane-item")){var i=r.height/3,p=r.width/3;r.top<=l.clientY&&r.top+i>=l.clientY?o="top":r.top+i<=l.clientY&&r.top+2*i>=l.clientY?o="middle":r.top+2*i<=l.clientY&&r.top+3*i>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?s="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?s="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(s="right")}e.xvar.drager.dragOverVertical==o&&e.xvar.drager.dragOverHorizontal==s||(e.xvar.drager.dragOverVertical=o,e.xvar.drager.dragOverHorizontal=s,console.log(e.xvar.drager))},off:function(){e.$target.off("dragover.ax5docker-"+e.instanceId).off("drop.ax5docker-"+e.instanceId).off("dragend.ax5docker-"+e.instanceId)}},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=s(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=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(r);"row"==o.type?(a.panels.splice(t,0,n),y()):(a=i(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=s(r);"row"==o.type?(a.panels.splice(t+1,0,n),y()):(a=i(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=s(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=i(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=s(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=i(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=s(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=i(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=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(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.93"},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)}}}(); |
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.3.92", | ||
"version": "1.3.93", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -583,3 +583,3 @@ /* | ||
this.xvar.drager = { | ||
this.xvar.dragger = { | ||
target: null, | ||
@@ -610,6 +610,9 @@ dragOverVertical: null, | ||
let $dragoverDom = jQuery(dragoverDom); | ||
if (this.xvar.drager.target == null || this.xvar.drager.target.get(0) != $dragoverDom.get(0)) { | ||
this.xvar.drager.target = $dragoverDom; | ||
this.xvar.drager.dragOverVertical = null; | ||
this.xvar.drager.dragOverHorizontal = null; | ||
if (this.xvar.dragger.target == null || this.xvar.dragger.target.get(0) != $dragoverDom.get(0)) { | ||
if(this.xvar.dragger.target) this.xvar.dragger.target.removeAttr("data-dropper"); | ||
this.xvar.dragger.target = $dragoverDom; | ||
this.xvar.dragger.dragOverVertical = null; | ||
this.xvar.dragger.dragOverHorizontal = null; | ||
} | ||
@@ -626,3 +629,24 @@ | ||
if ($dragoverDom.attr("data-ax5docker-pane-tab")) { | ||
let halfWidth = box.width / 2; | ||
if (box.left <= mouse.clientX && (box.left + halfWidth) >= mouse.clientX) { | ||
dragOverHorizontal = "left"; | ||
} | ||
else if ((box.left + halfWidth) <= mouse.clientX && (box.left + halfWidth * 2) >= mouse.clientX) { | ||
dragOverHorizontal = "right"; | ||
} | ||
if (this.xvar.dragger.dragOverHorizontal != dragOverHorizontal && typeof dragOverHorizontal != "undefined") { | ||
this.xvar.dragger.dragOverHorizontal = dragOverHorizontal; | ||
var draggerProcessor = { | ||
"left"($target){ | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right"($target){ | ||
$target.attr("data-dropper", "right"); | ||
}, | ||
}; | ||
draggerProcessor[this.xvar.dragger.dragOverHorizontal](this.xvar.dragger.target); | ||
} | ||
} | ||
@@ -653,11 +677,40 @@ else if ($dragoverDom.attr("data-ax5docker-pane-item")) { | ||
} | ||
} | ||
if (this.xvar.drager.dragOverVertical != dragOverVertical || this.xvar.drager.dragOverHorizontal != dragOverHorizontal) { | ||
this.xvar.drager.dragOverVertical = dragOverVertical; | ||
this.xvar.drager.dragOverHorizontal = dragOverHorizontal; | ||
console.log(this.xvar.drager); | ||
if (this.xvar.dragger.dragOverVertical != dragOverVertical || this.xvar.dragger.dragOverHorizontal != dragOverHorizontal) { | ||
this.xvar.dragger.dragOverVertical = dragOverVertical; | ||
this.xvar.dragger.dragOverHorizontal = dragOverHorizontal; | ||
var draggerProcessor = { | ||
"left-top"($target){ | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right-top"($target){ | ||
$target.attr("data-dropper", "right"); | ||
}, | ||
"center-top"($target){ | ||
$target.attr("data-dropper", "top"); | ||
}, | ||
"left-middle"($target){ | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right-middle"($target){ | ||
$target.attr("data-dropper", "right"); | ||
}, | ||
"center-middle"($target){ | ||
$target.attr("data-dropper", "center"); | ||
}, | ||
"left-bottom"($target){ | ||
$target.attr("data-dropper", "left"); | ||
}, | ||
"right-bottom"($target){ | ||
$target.attr("data-dropper", "right"); | ||
}, | ||
"center-bottom"($target){ | ||
$target.attr("data-dropper", "bottom"); | ||
}, | ||
}; | ||
draggerProcessor[this.xvar.dragger.dragOverHorizontal + "-" + this.xvar.dragger.dragOverVertical](this.xvar.dragger.target); | ||
} | ||
} | ||
//console.log(box, mouse); | ||
}, | ||
@@ -669,2 +722,4 @@ "off": () => { | ||
.off("dragend.ax5docker-" + this.instanceId); | ||
this.xvar.dragger.target.removeAttr("data-dropper"); | ||
} | ||
@@ -671,0 +726,0 @@ }; |
Sorry, the diff of this file is not supported yet
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
319644
2354