Seditio Source
Root |
./othercms/xenForo 2.2.8/js/xf/sort.min.js
'use strict';!function(d,f,g,h){XF.ListSorter=XF.Element.newHandler({options:{dragParent:null,dragHandle:null,undraggable:".is-undraggable",direction:"vertical",submitOnDrop:!1},drake:null,init:function(){if(this.options.dragParent)d(f).on("listSorterDuplication",XF.proxy(this,"drakeSetup"));this.$target.on("touchmove",this.options.dragHandle,function(b){b.preventDefault()});this.drakeSetup()},drakeSetup:function(){this.drake&&this.drake.destroy();var b=this.options.dragParent?this.$target.find(this.options.dragParent).get():
[this.$target.get(0)];this.drake=dragula(b,{moves:XF.proxy(this,"isMoveable"),accepts:XF.proxy(this,"isValidTarget"),direction:this.options.direction});if(this.options.submitOnDrop){var c=d(b).closest("form");if(c.length)this.drake.on("drop",function(e){c.submit()})}},isMoveable:function(b,c,e,a){c=this.options.dragHandle;a=this.options.undraggable;return c&&!d(e).closest(c).length||a&&d(b).closest(a).length?!1:!0},isValidTarget:function(b,c,e,a){for(b=a?d(a).prev():this.$target.children().last();b.length;){if(b.is(".js-blockDragafter"))return!1;
b=b.prev()}if(a)for(a=d(a);a.length;){if(a.is(".js-blockDragbefore"))return!1;a=a.next()}return!0}});XF.Element.register("list-sorter","XF.ListSorter")}(jQuery,window,document);