!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.sortable=redux.field_objects.sortable||{};var b="";redux.field_objects.sortable.init=function(c){c||(c=a(document).find(".redux-group-tab:visible").find(".redux-container-sortable:visible")),a(c).each(function(){var c=a(this),d=c;c.hasClass("redux-field-container")||(d=c.parents(".redux-field-container:first")),d.is(":hidden")||d.hasClass("redux-field-init")&&(d.removeClass("redux-field-init"),c.find(".redux-sortable").sortable({handle:".drag",placeholder:"placeholder",opacity:.7,scroll:!1,out:function(c,d){d.helper&&(b=d.offset.top>0?"down":"up",redux.field_objects.sortable.scrolling(a(this).parents(".redux-field-container:first")))},over:function(a,c){b=""},deactivate:function(a,c){b=""},update:function(){redux_change(a(this))}}),c.find(".checkbox_sortable").on("click",function(){a(this).is(":checked")?c.find("#"+a(this).attr("rel")).val(1):c.find("#"+a(this).attr("rel")).val("")}))})},redux.field_objects.sortable.scrolling=function(a){if(void 0!==a){var c=a.find(".redux-sorter");"up"==b?(c.scrollTop(c.scrollTop()-20),setTimeout(redux.field_objects.sortable.scrolling,50)):"down"==b&&(c.scrollTop(c.scrollTop()+20),setTimeout(redux.field_objects.sortable.scrolling,50))}}}(jQuery);