Edit File: themify-builder-drag.min.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,e,f){a instanceof String&&(a=String(a));for(var k=a.length,h=0;h<k;h++){var v=a[h];if(e.call(f,v,h,a))return{i:h,v:v}}return{i:-1,v:void 0}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,e,f){a!=Array.prototype&&a!=Object.prototype&&(a[e]=f.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}; $jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,e,f,k){if(e){f=$jscomp.global;a=a.split(".");for(k=0;k<a.length-1;k++){var h=a[k];h in f||(f[h]={});f=f[h]}a=a[a.length-1];k=f[a];e=e(k);e!=k&&null!=e&&$jscomp.defineProperty(f,a,{configurable:!0,writable:!0,value:e})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,f){return $jscomp.findInternal(this,a,f).v}},"es6-impl","es3"); (function(a,e,f,k){function h(b,c){this.element=a(b);this.options=a.extend({},A,c);this.init()}var v="desktop",r,n=!1,z,w=!0,q=!1,g,d,x,y,u,l,t=a(e.document),p,A={append:!0,dropitems:null,elements:null,type:"",cancel:null,onDragStart:null,onDrag:null,onDragEnter:null,onDragLeave:null,onDragEnd:null,onDrop:null};h.prototype={init:function(){!1===q&&(u=a("<div/>",{id:"tb_placeholder_body","class":"tb_placeholder_helper"}),q=a("<div/>",{id:"tb_placeholder_iframe","class":"tb_placeholder_helper"}),p= a("body"),p.prepend(q).on("themify_builder_change_mode",this.changeMode),x=k.toolbar.$el,y=a("#tb_fixed_bottom_scroll",t),a("body",t).append(u));this.element.off("mousedown.tb_visual").on("mousedown.tb_visual",this.mouseDown.bind(this))},elpos:{},is_enter:!1,first:null,size:{w:"",h:""},mouseDown:function(b){1!==b.which||b.target.classList.contains("tb_disable_sorting")?g=l=d=null:(b.preventDefault(),g=this.element,n=!1,this.first=null,w=!1,this.elpos=g.offset(),t.one("mousemove.tb_visual",this.firstMove.bind(this)).one("mouseup.tb_visual", this.mouseUp.bind(this)))},firstMove:function(b){b.preventDefault();b.stopPropagation();if(g){a.isFunction(this.options.onDragBefore)&&this.options.onDragBefore.call(this,b,g);var c=g[0].outerHTML;q.removeClass("drop_animate").hide().html(c);u.removeClass("drop_animate").hide().html(c);c=a("body",t);c=c.add(a("body"));c.addClass("tb_drag_start tb_drag_"+this.options.type);this.setCurrentPlaceHolder(b);l.show();this.size.w=l.outerWidth()/2;this.size.h=l.outerHeight();a(f).on("mousemove.tb_visual", this.mouseMove.bind(this)).on("mouseup.tb_visual",this.mouseUp.bind(this)).on("mouseenter.tb_visual",this.iframeEnter.bind(this)).on("mouseleave.tb_visual",this.iframeLeave.bind(this)).on("mouseenter.tb_visual",this.options.dropitems,this.mouseEnter.bind(this)).on("mouseleave.tb_visual",this.options.dropitems,this.mouseLeave.bind(this));t.on("mousemove.tb_visual",this.mouseMove.bind(this)).on("mouseup.tb_visual",this.mouseUp.bind(this));y.on("mouseenter.tb_visual",this.scroll.bind(this)).on("mouseleave.tb_visual", this.scrollUp.bind(this));x.on("mouseenter.tb_visual",this.scroll.bind(this)).on("mouseleave.tb_visual",this.scrollUp.bind(this));this.mouseMove(b);a.isFunction(this.options.onDragStart)&&this.options.onDragStart.call(this,b,g)}},mouseMove:function(b){if(g&&l)if(n){var c=this;var m=p.add(p.closest("html"));m.stop().animate({scrollTop:n},{duration:800,step:function(f){n?(f="down"===r?y.offset().top-z:x.offset().top+z,l.css("top",f)):m.stop();a.isFunction(c.options.onDrag)&&c.options.onDrag.call(c, b,g,d)},complete:function(){c.checkScrollEnd()||(m.stop(),n=r=!1,c.setPlaceHolder(b))}})}else{if(this.is_enter&&this.options.elements&&d){c=this;for(var f=this.is_enter.find(this.options.dropitems+","+this.options.elements).get().reverse(),e=0,k=f.length;e<k;++e){var h=a(f[e]);if(c.CheckIntersect(b,h)&&(!c.options.cancel||0===h.closest(c.options.cancel).length)){c.removeAttr();d=h;break}}}this.setPlaceHolder(b)}},SetSide:function(b){var a=d[0].getBoundingClientRect();b=.5<(b.clientY-a.top)/(a.bottom- a.top-20)?"bottom":"top";"top"===b&&d[0].parentNode===this.is_enter[0]&&0===d.index()&&(d=this.is_enter);d[0].dataset.pos!==b&&d.attr("data-pos",b)},setCurrentPlaceHolder:function(){l=w?q:u},setPlaceHolder:function(b){var c=void 0!==b.originalEvent?b.originalEvent:b;l.css({top:c.pageY-this.size.h-12,left:c.pageX-this.size.w});d&&this.SetSide(b);a.isFunction(this.options.onDrag)&&this.options.onDrag.call(this,b,g,d)},removeAttr:function(){for(var b=f.querySelectorAll("[data-pos]"),a=b.length-1;-1< a;--a)b[a].removeAttribute("data-pos")},mouseUp:function(b){a(f).off(".tb_visual");t.off(".tb_visual");y.off(".tb_visual");x.off(".tb_visual");if(g&&l&&!b.isTrigger){b.stopPropagation();var c={},m=this;var e=g.clone();d?(c.top=d.offset().top,c.left=d.offset().left,"bottom"===d[0].dataset.pos&&(c.top+=d.outerHeight())):(c.top=this.elpos.top,c.left=this.elpos.left);this.is_enter=n=g=null;l.addClass("drop_animate").css(c).one(k.Utils.transitionPrefix(),function(b){var c=a("body",t),c=c.add("body");"row"=== m.options.type&&setTimeout(function(){k.toolbar.$el.find('.tb_zoom[data-zoom="100"]').trigger("click")},1E3);c.removeClass("tb_drag_start tb_drag_"+m.options.type);d&&d[0].dataset.pos&&(e.hide(),"bottom"===d[0].dataset.pos?m.options.append&&!d[0].classList.contains(m.options.elements.replace(".",""))?d.append(e):d.after(e):m.options.append&&!d[0].classList.contains(m.options.elements.replace(".",""))?d.prepend(e):d.before(e),m.removeAttr(),a.isFunction(m.options.onDrop)&&m.options.onDrop.call(m,b, e,d),d=null);q.empty().removeAttr("style");u.empty().removeAttr("style")})}a.isFunction(this.options.onDragEnd)&&this.options.onDragEnd.call(this,b,e)},mouseEnter:function(b){g&&l&&(b.stopPropagation(),a(f).triggerHandler("mouseenter.tb_visual"),d=this.is_enter=a(b.currentTarget),this.removeAttr(),this.SetSide(b),a.isFunction(this.options.onDragEnter)&&this.options.onDragEnter.call(this,b,g,d))},mouseLeave:function(b){var c=a(b.currentTarget);if(g&&d&&!this.CheckIntersect(b,c)){var e=c.parent().closest(this.options.dropitems); 0<e.length&&this.CheckIntersect(b,e)?e.trigger("mouseenter.tb_visual"):(this.is_enter=null,this.removeAttr(),d=!1,a.isFunction(this.options.onDragLeave)&&this.options.onDragLeave.call(this,b,g,c))}},scroll:function(b){if(g&&l){var c=parseInt((p.height()-a(e).height())/5);b=a(b.currentTarget);"tb_fixed_bottom_scroll"===b.prop("id")?(n="+="+c+"px",r="down"):(n="-="+c+"px",r="up");0<c?z=b.height():n=!1}},checkScrollEnd:function(){var b=p.scrollTop();return"up"===r&&0!==b||"down"===r&&a(e).height()+b!== p.height()},CheckIntersect:function(a,c){var b=c.offset();return a.pageX>=b.left&&a.pageX<=b.left+c.outerWidth()&&a.pageY>=b.top&&a.pageY<=b.top+c.outerHeight()},scrollUp:function(a){g&&l&&(n=r=!1,p.add(p.closest("html")).stop())},iframeEnter:function(a){g&&l&&(a.stopPropagation(),w=!0,u.hide(),q.show(),this.setCurrentPlaceHolder(),null===this.first&&(this.first=!0,this.mouseMove(a)))},iframeLeave:function(a){if(g&&l){a.stopPropagation();var b=this;setTimeout(function(){w=r?("desktop"===v||"block"=== q.css("display"))&&b.checkScrollEnd():!1;w||(q.hide(),u.show(),b.setCurrentPlaceHolder())},5)}},changeMode:function(b,c,d){v=d;p="desktop"===v?a("body"):a("body",t)}};a.fn.ThemifyDraggable=function(b){for(var c=this.length-1;-1<c;--c)a.data(this[c],"plugin_ThemifyDraggable")||a.data(this[c],"plugin_ThemifyDraggable",new h(this[c],b));return this}})(jQuery,window.top,document,tb_app);
Back to File Manager