File "redux-sorter.min.js"
Full Path: /home/elegucvf/public_html/video/wp-content/plugins/atlas-core/framework/redux-core/inc/fields/sorter/redux-sorter.min.js
File size: 2.24 KB
MIME-type: text/plain
Charset: utf-8
!function(d){"use strict";var i="";redux.field_objects=redux.field_objects||{},redux.field_objects.sorter=redux.field_objects.sorter||{},redux.field_objects.sorter.init=function(t){t=d.redux.getSelector(t,"sorter"),d(t).each(function(){var e=d(this),t=e;(t=e.hasClass("redux-field-container")?t:e.parents(".redux-field-container:first")).is(":hidden")||t.hasClass("redux-field-init")&&(t.removeClass("redux-field-init"),e.find(".redux-sorter").each(function(){var t=d(this).attr("id"),s=d(this).hasClass("in-repeater");e.find("#"+t).find("ul").sortable({items:"li",placeholder:"placeholder",connectWith:".sortlist_"+t,opacity:.8,scroll:!1,out:function(t,e){e.helper&&(i=0<e.offset.top?"down":"up",redux.field_objects.sorter.scrolling(d(this).parents(".redux-field-container:first")))},over:function(){i=""},deactivate:function(){i=""},stop:function(t,e){var i,r;r=s?d(this).attr("data-repeater-id"):d(this).attr("data-id"),r=redux.optName.sorter[r],i=d(this).find("h3").text(),void 0!==r.limits&&r.limits&&i&&r.limits[i]&&(d(this).children("li").length>=r.limits[i]?(d(this).addClass("filled"),d(this).children("li").length>r.limits[i]&&d(e.sender).sortable("cancel")):d(this).removeClass("filled"))},update:function(t,e){var i,r;r=s?d(this).attr("data-repeater-id"):d(this).attr("data-id"),r=redux.optName.sorter[r],i=d(this).find("h3").text(),void 0!==r.limits&&r.limits&&i&&r.limits[i]&&(d(this).children("li").length>=r.limits[i]?(d(this).addClass("filled"),d(this).children("li").length>r.limits[i]&&d(e.sender).sortable("cancel")):d(this).removeClass("filled")),d(this).find(".position").each(function(){var t,e,i=d(this).parent().attr("data-id"),r=d(this).parent().parent().attr("data-group-id");redux_change(d(this)),e=d(this).parent().parent().attr("data-suffix"),t=s?d(this).parent().parent().attr("data-repeater-id"):d(this).parent().parent().attr("data-id"),d(this).prop("name",redux.optName.args.opt_name+"["+t+"]"+e+"["+r+"]["+i+"]")})}}),e.find(".redux-sorter").disableSelection()}))})},redux.field_objects.sorter.scrolling=function(t){void 0!==t&&(t=t.find(".redux-sorter"),"up"===i?(t.scrollTop(t.scrollTop()-20),setTimeout(redux.field_objects.sorter.scrolling,50)):"down"===i&&(t.scrollTop(t.scrollTop()+20),setTimeout(redux.field_objects.sorter.scrolling,50)))}}(jQuery);