File "redux-slider.min.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/kapee-extensions/inc/admin/redux-core/inc/fields/slider/redux-slider.min.js
File size: 2.79 KB
MIME-type: text/plain
Charset: utf-8

!function(m){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.slider=redux.field_objects.slider||{},redux.field_objects.slider.init=function(e){e=m.redux.getSelector(e,"slider"),m(e).each(function(){var g=m(this),e=g;(e=g.hasClass("redux-field-container")?e:g.parents(".redux-field-container:first")).is(":hidden")||e.hasClass("redux-field-init")&&(e.removeClass("redux-field-init"),g.find("div.redux-slider-container").each(function(){var e,i,t,d,l,r,a,s,n,o=m(this).data("id"),u=m(this).data("min"),c=m(this).data("max"),f=m(this).data("step"),x=m(this).data("handles"),h=m(this).data("default-one"),v=m(this).data("default-two"),p=m(this).data("resolution"),b=parseInt(m(this).data("display")),w=Boolean(m(this).data("rtl")),j=m(this).data("float-mark"),w=!0===w?"rtl":"ltr",_=[u,c],v=[h,v],h=[h];2===b?(l=t=g.find(".redux-slider-input-one-"+o),r=d=g.find(".redux-slider-input-two-"+o)):3===b?(t=g.find(".redux-slider-select-one-"+o),d=g.find(".redux-slider-select-two-"+o),redux.field_objects.slider.loadSelect(t,u,c,p,f),2===x&&redux.field_objects.slider.loadSelect(d,u,c,p,f)):1===b?(t=g.find("#redux-slider-label-one-"+o),d=g.find("#redux-slider-label-two-"+o)):0===b&&(t=g.find(".redux-slider-value-one-"+o),d=g.find(".redux-slider-value-two-"+o)),c=1===b?(a=[u=[t,"html"]],[u,[d,"html"]]):(a=[t],[t,d]),u=2===x?(e=v,i=c,!0):(e=h,i=a,"lower"),s=m(this).reduxNoUiSlider({range:_,start:e,handles:x,step:f,connect:u,behaviour:"tap-drag",direction:w,serialization:{resolution:p,to:i,mark:j},slide:function(){1===b&&(2===x?(n=s.val(),g.find("input.redux-slider-value-one-"+o).attr("value",n[0]),g.find("input.redux-slider-value-two-"+o).attr("value",n[1])):g.find("input.redux-slider-value-one-"+o).attr("value",s.val())),3===b&&(2===x?(g.find(".redux-slider-select-one").val(s.val()[0]).trigger("change"),g.find(".redux-slider-select-two").val(s.val()[1]).trigger("change")):g.find(".redux-slider-select-one").val(s.val())),redux_change(m(this))}}),2===b&&(l.on("keydown",function(e){var i=s.val(),t=parseInt(i[0]);switch(e.which){case 38:s.val([t+1,null]);break;case 40:s.val([t-1,null]);break;case 13:e.preventDefault()}}),2===x)&&r.on("keydown",function(e){var i=s.val(),t=parseInt(i[1]);switch(e.which){case 38:s.val([null,t+1]);break;case 40:s.val([null,t-1]);break;case 13:e.preventDefault()}})}),g.find("select.redux-slider-select-one, select.redux-slider-select-two").select2())})},redux.field_objects.slider.isFloat=function(e){return+e===e&&!isFinite(e)||Boolean(e%1)},redux.field_objects.slider.decimalCount=function(e){return e.toString().split(".")[1].length},redux.field_objects.slider.loadSelect=function(e,i,t,d){for(var l,r,a=i;a<=t;a+=d)r=a,redux.field_objects.slider.isFloat(d)&&(l=redux.field_objects.slider.decimalCount(d),r=a.toFixed(l)),m(e).append('<option value="'+r+'">'+r+"</option>")}}(jQuery);