From 5510d7661f75b842d3a9bf1a86f3b4ef9f88f904 Mon Sep 17 00:00:00 2001 From: IonDen Date: Mon, 29 Dec 2014 09:16:08 +0300 Subject: [PATCH] Update to 2.0.3 --- bower.json | 2 +- css/ion.rangeSlider.css | 11 ++- css/ion.rangeSlider.skinFlat.css | 4 +- css/ion.rangeSlider.skinHTML5.css | 4 +- css/ion.rangeSlider.skinModern.css | 4 +- css/ion.rangeSlider.skinNice.css | 4 +- css/ion.rangeSlider.skinSimple.css | 4 +- index.md | 4 +- ion-rangeSlider.jquery.json | 4 +- js/ion.rangeSlider.js | 150 +++++++++++++++-------------- js/ion.rangeSlider.min.js | 125 ++++++++++++------------ package.json | 2 +- readme.md | 5 +- readme.ru.md | 5 +- 14 files changed, 171 insertions(+), 157 deletions(-) diff --git a/bower.json b/bower.json index 8435930..f061a15 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ion.rangeSlider", - "version": "2.0.2", + "version": "2.0.3", "homepage": "https://github.com/IonDen/ion.rangeSlider", "authors": [ { diff --git a/css/ion.rangeSlider.css b/css/ion.rangeSlider.css index ddd31a5..dd56bef 100644 --- a/css/ion.rangeSlider.css +++ b/css/ion.rangeSlider.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider -// css version 2.0.2 +// css version 2.0.3 // © 2013-2014 Denis Ineshin | IonDen.com // ===================================================================================================================*/ @@ -119,12 +119,15 @@ background: rgba(0,0,0,0.0); z-index: 2; } +.lt-ie9 .irs-disable-mask { + background: #000; + filter: alpha(opacity=0); + cursor: not-allowed; +} + .irs-disabled { opacity: 0.4; } -.lt-ie9 .irs-disabled { - filter: alpha(opacity=40); -} .irs-hidden-input { diff --git a/css/ion.rangeSlider.skinFlat.css b/css/ion.rangeSlider.skinFlat.css index 90c52fb..166314e 100644 --- a/css/ion.rangeSlider.skinFlat.css +++ b/css/ion.rangeSlider.skinFlat.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider, Flat UI Skin -// css version 2.0.0 +// css version 2.0.3 // © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ @@ -61,7 +61,7 @@ top: 22px; background-position: 0 -120px; } -#irs-active-slider, .irs-slider:hover { +.irs-slider.state_hover, .irs-slider:hover { background-position: 0 -150px; } diff --git a/css/ion.rangeSlider.skinHTML5.css b/css/ion.rangeSlider.skinHTML5.css index 5c7083a..740d429 100644 --- a/css/ion.rangeSlider.skinHTML5.css +++ b/css/ion.rangeSlider.skinHTML5.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider, Simple Skin -// css version 2.0.0 +// css version 2.0.3 // © Denis Ineshin, 2014 https://github.com/IonDen // © guybowden, 2014 https://github.com/guybowden // ===================================================================================================================*/ @@ -72,7 +72,7 @@ cursor: pointer; } -#irs-active-slider, .irs-slider:hover { +.irs-slider.state_hover, .irs-slider:hover { background: #FFF; } diff --git a/css/ion.rangeSlider.skinModern.css b/css/ion.rangeSlider.skinModern.css index b0bf5d1..13009c1 100644 --- a/css/ion.rangeSlider.skinModern.css +++ b/css/ion.rangeSlider.skinModern.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider, Modern Skin -// css version 2.0.0 +// css version 2.0.3 // © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ @@ -61,7 +61,7 @@ top: 31px; background-position: 0 -120px; } -#irs-active-slider, .irs-slider:hover { +.irs-slider.state_hover, .irs-slider:hover { background-position: 0 -150px; } diff --git a/css/ion.rangeSlider.skinNice.css b/css/ion.rangeSlider.skinNice.css index 670c151..57b20d1 100644 --- a/css/ion.rangeSlider.skinNice.css +++ b/css/ion.rangeSlider.skinNice.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider, Nice Skin -// css version 2.0.0 +// css version 2.0.3 // © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ @@ -61,7 +61,7 @@ top: 17px; background-position: 0 -120px; } -#irs-active-slider, .irs-slider:hover { +.irs-slider.state_hover, .irs-slider:hover { background-position: 0 -150px; } diff --git a/css/ion.rangeSlider.skinSimple.css b/css/ion.rangeSlider.skinSimple.css index 04d9494..34fc7e2 100644 --- a/css/ion.rangeSlider.skinSimple.css +++ b/css/ion.rangeSlider.skinSimple.css @@ -1,5 +1,5 @@ /* Ion.RangeSlider, Simple Skin -// css version 2.0.0 +// css version 2.0.3 // © Denis Ineshin, 2014 https://github.com/IonDen // ===================================================================================================================*/ @@ -61,7 +61,7 @@ top: 21px; background-position: 0 -120px; } -#irs-active-slider, .irs-slider:hover { +.irs-slider.state_hover, .irs-slider:hover { background-position: 0 -150px; } diff --git a/index.md b/index.md index 0e733b2..b65acf1 100644 --- a/index.md +++ b/index.md @@ -1,10 +1,10 @@ -# Ion.Range Slider 2.0.2 +# Ion.Range Slider 2.0.3 > English description | Описание на русском Easy and light range slider * Project page and demos -* Download ion.rangeSlider-2.0.2.zip +* Download ion.rangeSlider-2.0.3.zip *** diff --git a/ion-rangeSlider.jquery.json b/ion-rangeSlider.jquery.json index 521cfd5..261eabb 100644 --- a/ion-rangeSlider.jquery.json +++ b/ion-rangeSlider.jquery.json @@ -1,6 +1,6 @@ { "name": "ion-rangeSlider", - "version": "2.0.2", + "version": "2.0.3", "title": "Ion.RangeSlider", "description": "Cool, comfortable and easily customizable range slider with many options and skin support", "keywords": [ @@ -30,7 +30,7 @@ "homepage": "https://github.com/IonDen/ion.rangeSlider", "docs": "https://github.com/IonDen/ion.rangeSlider/blob/master/readme.md", "demo": "http://ionden.com/a/plugins/ion.rangeSlider/en.html", - "download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.2.zip", + "download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.3.zip", "dependencies": { "jquery": ">=1.8" } diff --git a/js/ion.rangeSlider.js b/js/ion.rangeSlider.js index 19c27db..d9f2f57 100644 --- a/js/ion.rangeSlider.js +++ b/js/ion.rangeSlider.js @@ -1,5 +1,5 @@ // Ion.RangeSlider -// version 2.0.2 Build: 287 +// version 2.0.3 Build: 293 // © Denis Ineshin, 2014 https://github.com/IonDen // // Project page: http://ionden.com/a/plugins/ion.rangeSlider/en.html @@ -32,9 +32,6 @@ return false; } ()); - var is_touch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); - - // IE8 fix if (!Function.prototype.bind) { Function.prototype.bind = function bind(that) { @@ -113,7 +110,7 @@ // Core var IonRangeSlider = function (input, options, plugin_count) { - this.VERSION = "2.0.2"; + this.VERSION = "2.0.3"; this.input = input; this.plugin_count = plugin_count; this.current_plugin = 0; @@ -411,8 +408,10 @@ if (this.options.disable) { this.appendDisableMask(); + this.$cache.input[0].disabled = true; } else { this.$cache.cont.removeClass("irs-disabled"); + this.$cache.input[0].disabled = false; this.bindEvents(); } }, @@ -428,21 +427,15 @@ this.$cache.line.off("keydown.irs_" + this.plugin_count); - if (is_touch) { + this.$cache.body.off("touchmove.irs_" + this.plugin_count); + this.$cache.body.off("mousemove.irs_" + this.plugin_count); - this.$cache.body.off("touchmove.irs_" + this.plugin_count); - this.$cache.win.off("touchend.irs_" + this.plugin_count); - - } else { - - this.$cache.body.off("mousemove.irs_" + this.plugin_count); - this.$cache.win.off("mouseup.irs_" + this.plugin_count); - - if (is_old_ie) { - this.$cache.body.off("mouseup.irs_" + this.plugin_count); - this.$cache.body.off("mouseleave.irs_" + this.plugin_count); - } + this.$cache.win.off("touchend.irs_" + this.plugin_count); + this.$cache.win.off("mouseup.irs_" + this.plugin_count); + if (is_old_ie) { + this.$cache.body.off("mouseup.irs_" + this.plugin_count); + this.$cache.body.off("mouseleave.irs_" + this.plugin_count); } this.$cache.grid_labels = []; @@ -455,62 +448,48 @@ }, bindEvents: function () { - if (is_touch) { - - this.$cache.body.on("touchmove.irs_" + this.plugin_count, this.pointerMove.bind(this)); - this.$cache.win.on("touchend.irs_" + this.plugin_count, this.pointerUp.bind(this)); - - this.$cache.line.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.body.on("touchmove.irs_" + this.plugin_count, this.pointerMove.bind(this)); + this.$cache.body.on("mousemove.irs_" + this.plugin_count, this.pointerMove.bind(this)); - if (this.options.drag_interval && this.options.type === "double") { - this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")); - } else { - this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - } + this.$cache.win.on("touchend.irs_" + this.plugin_count, this.pointerUp.bind(this)); + this.$cache.win.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); - if (this.options.type === "single") { - this.$cache.s_single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); - this.$cache.shad_single.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - } else { - this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); - this.$cache.s_to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); - this.$cache.shad_from.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - this.$cache.shad_to.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - } + this.$cache.line.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.line.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + if (this.options.drag_interval && this.options.type === "double") { + this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")); + this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")); } else { + this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } - if (this.options.keyboard) { - this.$cache.line.on("keydown.irs_" + this.plugin_count, this.key.bind(this, "keyboard")); - } - - this.$cache.body.on("mousemove.irs_" + this.plugin_count, this.pointerMove.bind(this)); - this.$cache.win.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); - - if (is_old_ie) { - this.$cache.body.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); - this.$cache.body.on("mouseleave.irs_" + this.plugin_count, this.pointerUp.bind(this)); - } - - this.$cache.line.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + if (this.options.type === "single") { + this.$cache.s_single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.shad_single.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - if (this.options.drag_interval && this.options.type === "double") { - this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")); - } else { - this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - } + this.$cache.s_single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); + this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } else { + this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.s_to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.shad_from.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.shad_to.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.s_from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); + this.$cache.s_to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); + this.$cache.shad_from.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + this.$cache.shad_to.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); + } - if (this.options.type === "single") { - this.$cache.s_single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")); - this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - } else { - this.$cache.s_from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")); - this.$cache.s_to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")); - this.$cache.shad_from.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - this.$cache.shad_to.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")); - } + if (this.options.keyboard) { + this.$cache.line.on("keydown.irs_" + this.plugin_count, this.key.bind(this, "keyboard")); + } + if (is_old_ie) { + this.$cache.body.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)); + this.$cache.body.on("mouseleave.irs_" + this.plugin_count, this.pointerUp.bind(this)); } }, @@ -518,8 +497,9 @@ if (!this.dragging) { return; } - var e_base = is_touch ? e.originalEvent.touches[0] : e; - this.coords.x_pointer = e_base.pageX - this.coords.x_gap; + + var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; + this.coords.x_pointer = x - this.coords.x_gap; this.calc(); }, @@ -542,6 +522,8 @@ this.options.onFinish(this.result); } + this.$cache.cont.find(".state_hover").removeClass("state_hover"); + this.force_redraw = true; this.dragging = false; @@ -552,7 +534,7 @@ pointerDown: function (target, e) { e.preventDefault(); - var e_base = is_touch ? e.originalEvent.touches[0] : e; + var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; if (e.button === 2) { return; } @@ -564,7 +546,7 @@ this.dragging = true; this.coords.x_gap = this.$cache.rs.offset().left; - this.coords.x_pointer = e_base.pageX - this.coords.x_gap; + this.coords.x_pointer = x - this.coords.x_gap; this.calcPointer(); @@ -574,11 +556,13 @@ break; case "from": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_from); + this.$cache.s_from.addClass("state_hover"); this.$cache.s_from.addClass("type_last"); this.$cache.s_to.removeClass("type_last"); break; case "to": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_to); + this.$cache.s_to.addClass("state_hover"); this.$cache.s_to.addClass("type_last"); this.$cache.s_from.removeClass("type_last"); break; @@ -599,7 +583,7 @@ pointerClick: function (target, e) { e.preventDefault(); - var e_base = is_touch ? e.originalEvent.touches[0] : e; + var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; if (e.button === 2) { return; } @@ -609,7 +593,7 @@ this.is_click = true; this.coords.x_gap = this.$cache.rs.offset().left; - this.coords.x_pointer = +(e_base.pageX - this.coords.x_gap).toFixed(); + this.coords.x_pointer = +(x - this.coords.x_gap).toFixed(); this.force_redraw = true; this.calc(); @@ -660,6 +644,10 @@ }, setMinMax: function () { + if (!this.options) { + return; + } + if (this.options.hide_min_max) { this.$cache.min[0].style.display = "none"; this.$cache.max[0].style.display = "none"; @@ -684,6 +672,10 @@ // Calculations calc: function (update) { + if (!this.options) { + return; + } + this.calc_count++; if (this.calc_count === 10 || update) { @@ -903,6 +895,10 @@ // Drawings updateScene: function () { + if (!this.options) { + return; + } + this.drawHandles(); this.raf_id = requestAnimationFrame(this.updateScene.bind(this)); @@ -911,6 +907,10 @@ drawHandles: function () { this.coords.w_rs = this.$cache.rs.outerWidth(false); + if (!this.coords.w_rs) { + return; + } + if (this.coords.w_rs !== this.coords.w_rs_old) { this.target = "base"; this.is_resize = true; @@ -1008,6 +1008,10 @@ }, drawLabels: function () { + if (!this.options) { + return; + } + var values_num = this.options.values.length, p_values = this.options.p_values, text_single, @@ -1741,6 +1745,10 @@ update: function (options) { this.is_update = true; + + this.options.from = this.result.from; + this.options.to = this.result.to; + this.options = $.extend(this.options, options); this.validate(); this.updateResult(options); diff --git a/js/ion.rangeSlider.min.js b/js/ion.rangeSlider.min.js index f631104..57e05f8 100644 --- a/js/ion.rangeSlider.min.js +++ b/js/ion.rangeSlider.min.js @@ -1,65 +1,66 @@ -// Ion.RangeSlider | version 2.0.2 | https://github.com/IonDen/ion.rangeSlider -(function(e,s,g,q,u){var t=0,p=function(){var a=q.userAgent,b=/msie\s\d+/i;return 0a)?(e("html").addClass("lt-ie9"),!0):!1}(),l="ontouchstart"in g||0');this.$cache.input.prop("readonly", +// Ion.RangeSlider | version 2.0.3 | https://github.com/IonDen/ion.rangeSlider +(function(e,q,g,r,u){var t=0,n=function(){var a=r.userAgent,b=/msie\s\d+/i;return 0a)?(e("html").addClass("lt-ie9"),!0):!1}();Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=[].slice;if("function"!=typeof b)throw new TypeError;var d=c.call(arguments,1),h=function(){if(this instanceof h){var f=function(){};f.prototype=b.prototype;var f=new f,k=b.apply(f,d.concat(c.call(arguments)));return Object(k)===k?k:f}return b.apply(a, +d.concat(c.call(arguments)))};return h});var p=function(a,b,c){this.VERSION="2.0.3";this.input=a;this.plugin_count=c;this.old_to=this.old_from=this.calc_count=this.current_plugin=0;this.raf_id=null;this.is_update=this.is_key=this.force_redraw=this.dragging=!1;this.is_start=!0;this.is_click=this.is_resize=this.is_active=!1;this.$cache={win:e(g),body:e(q.body),input:e(a),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,s_to:null,shad_single:null, +shad_from:null,shad_to:null,grid:null,grid_labels:[]};a=this.$cache.input;a={type:a.data("type"),min:a.data("min"),max:a.data("max"),from:a.data("from"),to:a.data("to"),step:a.data("step"),min_interval:a.data("minInterval"),max_interval:a.data("maxInterval"),drag_interval:a.data("dragInterval"),values:a.data("values"),from_fixed:a.data("fromFixed"),from_min:a.data("fromMin"),from_max:a.data("fromMax"),from_shadow:a.data("fromShadow"),to_fixed:a.data("toFixed"),to_min:a.data("toMin"),to_max:a.data("toMax"), +to_shadow:a.data("toShadow"),prettify_enabled:a.data("prettifyEnabled"),prettify_separator:a.data("prettifySeparator"),force_edges:a.data("forceEdges"),keyboard:a.data("keyboard"),keyboard_step:a.data("keyboardStep"),grid:a.data("grid"),grid_margin:a.data("gridMargin"),grid_num:a.data("gridNum"),grid_snap:a.data("gridSnap"),hide_min_max:a.data("hideMinMax"),hide_from_to:a.data("hideFromTo"),prefix:a.data("prefix"),postfix:a.data("postfix"),max_postfix:a.data("maxPostfix"),decorate_both:a.data("decorateBoth"), +values_separator:a.data("valuesSeparator"),disable:a.data("disable")};a.values=a.values&&a.values.split(",");b=e.extend(a,b);this.options=e.extend({type:"single",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:" ",prettify:null,force_edges:!1,keyboard:!1,keyboard_step:5,grid:!1,grid_margin:!0,grid_num:4, +grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:"",postfix:"",max_postfix:"",decorate_both:!0,values_separator:" \u2014 ",disable:!1,onStart:null,onChange:null,onFinish:null,onUpdate:null},b);this.validate();this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null};this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0, +p_step:0,p_pointer:0,p_handle:0,p_single:0,p_single_real:0,p_from:0,p_from_real:0,p_to:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],big_x:[]};this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from:0,p_from_left:0,p_to:0,p_to_left:0,p_single:0,p_single_left:0};this.init()};p.prototype={init:function(a){this.coords.p_step=this.options.step/((this.options.max-this.options.min)/100);this.target="base";this.toggleInput();this.append();this.setMinMax(); +if(a){if(this.force_redraw=!0,this.calc(!0),this.options.onUpdate&&"function"===typeof this.options.onUpdate)this.options.onUpdate(this.result)}else if(this.force_redraw=!0,this.calc(!0),this.options.onStart&&"function"===typeof this.options.onStart)this.options.onStart(this.result);this.updateScene();this.raf_id=requestAnimationFrame(this.updateScene.bind(this))},append:function(){this.$cache.input.before('');this.$cache.input.prop("readonly", !0);this.$cache.cont=this.$cache.input.prev();this.result.slider=this.$cache.cont;this.$cache.cont.html('01000');this.$cache.rs= this.$cache.cont.find(".irs");this.$cache.min=this.$cache.cont.find(".irs-min");this.$cache.max=this.$cache.cont.find(".irs-max");this.$cache.from=this.$cache.cont.find(".irs-from");this.$cache.to=this.$cache.cont.find(".irs-to");this.$cache.single=this.$cache.cont.find(".irs-single");this.$cache.bar=this.$cache.cont.find(".irs-bar");this.$cache.line=this.$cache.cont.find(".irs-line");this.$cache.grid=this.$cache.cont.find(".irs-grid");"single"===this.options.type?(this.$cache.cont.append(''), this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append(''),this.$cache.s_from=this.$cache.cont.find(".from"),this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from= -this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"));this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none");this.appendGrid();this.options.disable?this.appendDisableMask():(this.$cache.cont.removeClass("irs-disabled"),this.bindEvents())},appendDisableMask:function(){this.$cache.cont.append('');this.$cache.cont.addClass("irs-disabled")}, -remove:function(){this.$cache.cont.remove();this.$cache.cont=null;this.$cache.line.off("keydown.irs_"+this.plugin_count);l?(this.$cache.body.off("touchmove.irs_"+this.plugin_count),this.$cache.win.off("touchend.irs_"+this.plugin_count)):(this.$cache.body.off("mousemove.irs_"+this.plugin_count),this.$cache.win.off("mouseup.irs_"+this.plugin_count),p&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)));this.$cache.grid_labels=[];this.coords.big= -[];this.coords.big_w=[];this.coords.big_p=[];this.coords.big_x=[];cancelAnimationFrame(this.raf_id)},bindEvents:function(){if(l){this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));if(this.options.drag_interval&&"double"===this.options.type)this.$cache.bar.on("touchstart.irs_"+this.plugin_count, -this.pointerDown.bind(this,"both"));else this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));"single"===this.options.type?(this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count, -this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")))}else{if(this.options.keyboard)this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard"));this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)); -p&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this)));this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));if(this.options.drag_interval&&"double"===this.options.type)this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"));else this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")); -"single"===this.options.type?(this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")), -this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")))}},pointerMove:function(a){this.dragging&&(this.coords.x_pointer=(l?a.originalEvent.touches[0]:a).pageX-this.coords.x_gap,this.calc())},pointerUp:function(a){if(this.current_plugin===this.plugin_count&&this.is_active){this.is_active=!1;var b=this.options.onFinish&&"function"===typeof this.options.onFinish;a=e.contains(this.$cache.cont[0],a.target)||this.dragging;if(b&&a)this.options.onFinish(this.result); -this.force_redraw=!0;this.dragging=!1;p&&e("*").prop("unselectable",!1)}},pointerDown:function(a,b){b.preventDefault();var c=l?b.originalEvent.touches[0]:b;if(2!==b.button){this.current_plugin=this.plugin_count;this.target=a;this.dragging=this.is_active=!0;this.coords.x_gap=this.$cache.rs.offset().left;this.coords.x_pointer=c.pageX-this.coords.x_gap;this.calcPointer();switch(a){case "single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single);break;case "from":this.coords.p_gap= -this.toFixed(this.coords.p_pointer-this.coords.p_from);this.$cache.s_from.addClass("type_last");this.$cache.s_to.removeClass("type_last");break;case "to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to);this.$cache.s_to.addClass("type_last");this.$cache.s_from.removeClass("type_last");break;case "both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from),this.coords.p_gap_right=this.toFixed(this.coords.p_to-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"), -this.$cache.s_from.removeClass("type_last")}p&&e("*").prop("unselectable",!0);this.$cache.line.trigger("focus")}},pointerClick:function(a,b){b.preventDefault();var c=l?b.originalEvent.touches[0]:b;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(c.pageX-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(a,b){if(!(this.current_plugin!== -this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault();this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(a){var b=this.coords.p_pointer,b=a?b+this.options.keyboard_step:b-this.options.keyboard_step;this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*b);this.is_key=!0;this.calc()},setMinMax:function(){this.options.hide_min_max?(this.$cache.min[0].style.display= -"none",this.$cache.max[0].style.display="none"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1))}, -calc:function(a){this.calc_count++;if(10===this.calc_count||a)this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1);if(this.coords.w_rs){this.calcPointer();this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100);a=100-this.coords.p_handle;var b=this.toFixed(this.coords.p_pointer-this.coords.p_gap);"click"===this.target&&(b=this.toFixed(this.coords.p_pointer- -this.coords.p_handle/2),this.target=this.chooseHandle(b));0>b?b=0:b>a&&(b=a);switch(this.target){case "base":b=(this.options.max-this.options.min)/100;a=(this.result.from-this.options.min)/b;b=(this.result.to-this.options.min)/b;this.coords.p_single_real=this.toFixed(a);this.coords.p_from_real=this.toFixed(a);this.coords.p_to_real=this.toFixed(b);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real, -this.options.from_min,this.options.from_max);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_single=this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_from=this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_to=this.toFixed(b-this.coords.p_handle/100*b);this.target=null;break;case "single":if(this.options.from_fixed)break;this.coords.p_single_real=this.calcWithStep(b/a*100);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real, -this.options.from_min,this.options.from_max);this.coords.p_single=this.toFixed(this.coords.p_single_real/100*a);break;case "from":if(this.options.from_fixed)break;this.coords.p_from_real=this.calcWithStep(b/a*100);this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real, -"from");this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from=this.toFixed(this.coords.p_from_real/100*a);break;case "to":if(this.options.to_fixed)break;this.coords.p_to_real=this.calcWithStep(b/a*100);this.coords.p_to_realthis.coords.x_pointer?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer= -0},chooseHandle:function(a){return"single"===this.options.type?"single":a>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/ -this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single+this.coords.p_handle/2-this.labels.p_single/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from+this.coords.p_handle/2-this.labels.p_from/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from),this.labels.w_to=this.$cache.to.outerWidth(!1), -this.labels.p_to=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to+this.coords.p_handle/2-this.labels.p_to/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to)/2-this.labels.p_single/ -2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left)),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single))},updateScene:function(){this.drawHandles();this.raf_id=requestAnimationFrame(this.updateScene.bind(this))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1);this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0);if(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)this.setMinMax(),this.calc(!0), -this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow();if(this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)){if(this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key){this.drawLabels();this.$cache.bar[0].style.left=this.coords.p_bar_x+"%";this.$cache.bar[0].style.width=this.coords.p_bar_w+"%";if("single"===this.options.type)this.$cache.s_single[0].style.left= -this.coords.p_single+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value),this.$cache.input.data("from",this.result.from_value)):(this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from));else{this.$cache.s_from[0].style.left=this.coords.p_from+"%";this.$cache.s_to[0].style.left=this.coords.p_to+"%";if(this.old_from!==this.result.from||this.force_redraw)this.$cache.from[0].style.left= -this.labels.p_from_left+"%";if(this.old_to!==this.result.to||this.force_redraw)this.$cache.to[0].style.left=this.labels.p_to_left+"%";this.$cache.single[0].style.left=this.labels.p_single_left+"%";this.options.values.length?(this.$cache.input.prop("value",this.result.from_value+";"+this.result.to_value),this.$cache.input.data("from",this.result.from_value),this.$cache.input.data("to",this.result.to_value)):(this.$cache.input.prop("value",this.result.from+";"+this.result.to),this.$cache.input.data("from", -this.result.from),this.$cache.input.data("to",this.result.to))}this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||this.$cache.input.trigger("change");this.old_from=this.result.from;this.old_to=this.result.to;if(this.options.onChange&&"function"===typeof this.options.onChange&&!this.is_resize&&!this.is_update&&!this.is_start)this.options.onChange(this.result);if(this.options.onFinish&&"function"===typeof this.options.onFinish&&(this.is_key||this.is_click))this.options.onFinish(this.result); -this.is_resize=this.is_update=!1}this.force_redraw=this.is_click=this.is_key=this.is_start=!1}},drawLabels:function(){var a=this.options.values.length,b=this.options.p_values,c;if(!this.options.hide_from_to)if("single"===this.options.type)a=a?this.decorate(b[this.result.from]):this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a),this.calcLabels(),this.$cache.min[0].style.visibility=this.labels.p_single_left100-this.labels.p_max-1?"hidden":"visible";else{a?(this.options.decorate_both?(a=this.decorate(b[this.result.from]),a+=this.options.values_separator,a+=this.decorate(b[this.result.to])):a=this.decorate(b[this.result.from]+this.options.values_separator+b[this.result.to]),c=this.decorate(b[this.result.from]),b=this.decorate(b[this.result.to])):(this.options.decorate_both?(a=this.decorate(this._prettify(this.result.from)),a+=this.options.values_separator, -a+=this.decorate(this._prettify(this.result.to))):a=this.decorate(this._prettify(this.result.from)+this.options.values_separator+this._prettify(this.result.to),this.result.from),c=this.decorate(this._prettify(this.result.from),this.result.from),b=this.decorate(this._prettify(this.result.to),this.result.to));this.$cache.single.html(a);this.$cache.from.html(c);this.$cache.to.html(b);this.calcLabels();b=Math.min(this.labels.p_single_left,this.labels.p_from_left);a=this.labels.p_single_left+this.labels.p_single; -c=this.labels.p_to_left+this.labels.p_to;var d=Math.max(a,c);this.labels.p_from_left+this.labels.p_from>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?(this.$cache.from[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden",d=c):(this.$cache.from[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",d=Math.max(a, -c))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden");this.$cache.min[0].style.visibility=b100-this.labels.p_max-1?"hidden":"visible"}},drawShadow:function(){var a=this.options,b=this.$cache,c,d;"single"===a.type?a.from_shadow&&(a.from_min||a.from_max)?(c=this.calcPercent(a.from_min||a.min),d=this.calcPercent(a.from_max||a.max)- -c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,b.shad_single[0].style.display="block",b.shad_single[0].style.left=c+"%",b.shad_single[0].style.width=d+"%"):b.shad_single[0].style.display="none":(a.from_shadow&&(a.from_min||a.from_max)?(c=this.calcPercent(a.from_min||a.min),d=this.calcPercent(a.from_max||a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2, -b.shad_from[0].style.display="block",b.shad_from[0].style.left=c+"%",b.shad_from[0].style.width=d+"%"):b.shad_from[0].style.display="none",a.to_shadow&&(a.to_min||a.to_max)?(c=this.calcPercent(a.to_min||a.min),a=this.calcPercent(a.to_max||a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),a=this.toFixed(a-this.coords.p_handle/100*a),c+=this.coords.p_handle/2,b.shad_to[0].style.display="block",b.shad_to[0].style.left=c+"%",b.shad_to[0].style.width=a+"%"):b.shad_to[0].style.display="none")},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input")}, -calcPercent:function(a){return this.toFixed((a-this.options.min)/((this.options.max-this.options.min)/100))},calcReal:function(a){var b=this.options.min,c=this.options.max,d=0;0>b&&(d=Math.abs(b),b+=d,c+=d);a=(c-b)/100*a+b;(b=this.options.step.toString().split(".")[1])?a=+a.toFixed(b.length):(a/=this.options.step,a*=this.options.step,a=+a.toFixed(0));d&&(a-=d);athis.options.max&&(a=this.options.max);return b?+a.toFixed(b.length):this.toFixed(a)},calcWithStep:function(a){var b= -Math.round(a/this.coords.p_step)*this.coords.p_step;100d.max_interval&&(a=b- -d.max_interval):a-b>d.max_interval&&(a=b+d.max_interval);return this.calcPercent(a)},checkDiapason:function(a,b,c){a=this.calcReal(a);var d=this.options;b&&"number"===typeof b||(b=d.min);c&&"number"===typeof c||(c=d.max);ac&&(a=c);return this.calcPercent(a)},toFixed:function(a){a=a.toFixed(5);return+a},_prettify:function(a){return this.options.prettify_enabled?this.options.prettify&&"function"===typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},prettify:function(a){return a.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, -"$1"+this.options.prettify_separator)},checkEdges:function(a,b){if(!this.options.force_edges)return this.toFixed(a);0>a?a=0:a>100-b&&(a=100-b);return this.toFixed(a)},validate:function(){var a=this.options,b=this.result,c=a.values,d=c.length,h,f;"string"===typeof a.min&&(a.min=+a.min);"string"===typeof a.max&&(a.max=+a.max);"string"===typeof a.from&&(a.from=+a.from);"string"===typeof a.to&&(a.to=+a.to);"string"===typeof a.step&&(a.step=+a.step);"string"===typeof a.from_min&&(a.from_min=+a.from_min); -"string"===typeof a.from_max&&(a.from_max=+a.from_max);"string"===typeof a.to_min&&(a.to_min=+a.to_min);"string"===typeof a.to_max&&(a.to_max=+a.to_max);"string"===typeof a.keyboard_step&&(a.keyboard_step=+a.keyboard_step);"string"===typeof a.grid_num&&(a.grid_num=+a.grid_num);a.max<=a.min&&(a.max=a.min?2*a.min:a.min+1,a.step=1);if(d)for(a.p_values=[],a.min=0,a.max=d-1,a.step=1,a.grid_num=a.max,a.grid_snap=!0,f=0;fa.max)a.from=a.min;if(a.to>a.max||a.toa.to&&(a.from=a.to);if("number"!==typeof a.step||isNaN(a.step)||!a.step||0>a.step)a.step=1;if("number"!==typeof a.keyboard_step||isNaN(a.keyboard_step)||!a.keyboard_step||0>a.keyboard_step)a.keyboard_step=5;a.from_min&&a.froma.from_max&&(a.from=a.from_max); -a.to_min&&a.toa.to_max&&(a.to=a.to_max);if(b){b.min!==a.min&&(b.min=a.min);b.max!==a.max&&(b.max=a.max);if(b.fromb.max)b.from=a.from;if(b.tob.max)b.to=a.to}if("number"!==typeof a.min_interval||isNaN(a.min_interval)||!a.min_interval||0>a.min_interval)a.min_interval=0;if("number"!==typeof a.max_interval||isNaN(a.max_interval)||!a.max_interval||0>a.max_interval)a.max_interval=0;a.min_interval&&a.min_interval>a.max-a.min&&(a.min_interval= -a.max-a.min);a.max_interval&&a.max_interval>a.max-a.min&&(a.max_interval=a.max-a.min)},decorate:function(a,b){var c="",d=this.options;d.prefix&&(c+=d.prefix);c+=a;d.max_postfix&&(d.values.length&&a===d.p_values[d.max]?(c+=d.max_postfix,d.postfix&&(c+=" ")):b===d.max&&(c+=d.max_postfix,d.postfix&&(c+=" ")));d.postfix&&(c+=d.postfix);return c},updateFrom:function(){this.result.from=this.options.from;this.result.from_percent=this.calcPercent(this.result.from);this.options.values&&(this.result.from_value= -this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to;this.result.to_percent=this.calcPercent(this.result.to);this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(){this.result.min=this.options.min;this.result.max=this.options.max;this.updateFrom();this.updateTo()},appendGrid:function(){if(this.options.grid){var a=this.options,b,c;b=a.max-a.min;var d=a.grid_num,h=0,f=0,k=4,e,g,m=0,n="";this.calcGridMargin();a.grid_snap? -(d=b/a.step,h=this.toFixed(a.step/(b/100))):h=this.toFixed(100/d);4e&&(e=0));this.coords.big[b]=f;g=(f-h*(b-1))/(e+1);for(c=1;c<=e&&0!==f;c++)m=this.toFixed(f-g*c),n+='';n+='';m=this.calcReal(f);m=a.values.length?a.p_values[m]:this._prettify(m);n+=''+m+""}this.coords.big_num=Math.ceil(d+1);this.$cache.cont.addClass("irs-with-grid");this.$cache.grid.html(n);this.cacheGridLabels()}},cacheGridLabels:function(){var a,b,c=this.coords.big_num;for(b=0;b100-this.coords.grid_gap&&(c[d-1]=100-this.coords.grid_gap,b[d-1]=this.toFixed(c[d-1]-this.coords.big_p[d-1]), -this.coords.big_x[d-1]=this.toFixed(this.coords.big_p[d-1]-this.coords.grid_gap)));this.calcGridCollision(2,b,c);this.calcGridCollision(4,b,c);for(a=0;a=g)break;f=this.$cache.grid_labels[e][0];f.style.visibility=c[d]<=b[e]?"visible":"hidden"}},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1), -this.coords.w_rs&&(this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(a){this.is_update=!0;this.options=e.extend(this.options,a);this.validate(); -this.updateResult(a);this.toggleInput();this.remove();this.init(!0)},reset:function(){this.updateResult();this.update()},destroy:function(){this.toggleInput();this.$cache.input.prop("readonly",!1);e.data(this.input,"ionRangeSlider",null);this.remove();this.options=this.input=null}};e.fn.ionRangeSlider=function(a){return this.each(function(){e.data(this,"ionRangeSlider")||e.data(this,"ionRangeSlider",new r(this,a,t++))})};(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c'); +this.$cache.cont.addClass("irs-disabled")},remove:function(){this.$cache.cont.remove();this.$cache.cont=null;this.$cache.line.off("keydown.irs_"+this.plugin_count);this.$cache.body.off("touchmove.irs_"+this.plugin_count);this.$cache.body.off("mousemove.irs_"+this.plugin_count);this.$cache.win.off("touchend.irs_"+this.plugin_count);this.$cache.win.off("mouseup.irs_"+this.plugin_count);n&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)); +this.$cache.grid_labels=[];this.coords.big=[];this.coords.big_w=[];this.coords.big_p=[];this.coords.big_x=[];cancelAnimationFrame(this.raf_id)},bindEvents:function(){this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.line.on("touchstart.irs_"+ +this.plugin_count,this.pointerClick.bind(this,"click"));this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+ +this.plugin_count,this.pointerClick.bind(this,"click")));"single"===this.options.type?(this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.s_from.on("touchstart.irs_"+ +this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this, +"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")));if(this.options.keyboard)this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard"));n&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this)))},pointerMove:function(a){this.dragging&& +(this.coords.x_pointer=(a.pageX||a.originalEvent.touches&&a.originalEvent.touches[0].pageX)-this.coords.x_gap,this.calc())},pointerUp:function(a){if(this.current_plugin===this.plugin_count&&this.is_active){this.is_active=!1;var b=this.options.onFinish&&"function"===typeof this.options.onFinish;a=e.contains(this.$cache.cont[0],a.target)||this.dragging;if(b&&a)this.options.onFinish(this.result);this.$cache.cont.find(".state_hover").removeClass("state_hover");this.force_redraw=!0;this.dragging=!1;n&& +e("*").prop("unselectable",!1)}},pointerDown:function(a,b){b.preventDefault();var c=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;if(2!==b.button){this.current_plugin=this.plugin_count;this.target=a;this.dragging=this.is_active=!0;this.coords.x_gap=this.$cache.rs.offset().left;this.coords.x_pointer=c-this.coords.x_gap;this.calcPointer();switch(a){case "single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single);break;case "from":this.coords.p_gap=this.toFixed(this.coords.p_pointer- +this.coords.p_from);this.$cache.s_from.addClass("state_hover");this.$cache.s_from.addClass("type_last");this.$cache.s_to.removeClass("type_last");break;case "to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to);this.$cache.s_to.addClass("state_hover");this.$cache.s_to.addClass("type_last");this.$cache.s_from.removeClass("type_last");break;case "both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from),this.coords.p_gap_right=this.toFixed(this.coords.p_to- +this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}n&&e("*").prop("unselectable",!0);this.$cache.line.trigger("focus")}},pointerClick:function(a,b){b.preventDefault();var c=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(c-this.coords.x_gap).toFixed(),this.force_redraw= +!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(a,b){if(!(this.current_plugin!==this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault();this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(a){var b=this.coords.p_pointer,b=a?b+this.options.keyboard_step:b-this.options.keyboard_step;this.coords.x_pointer=this.toFixed(this.coords.w_rs/100* +b);this.is_key=!0;this.calc()},setMinMax:function(){this.options&&(this.options.hide_min_max?(this.$cache.min[0].style.display="none",this.$cache.max[0].style.display="none"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max), +this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)))},calc:function(a){if(this.options){this.calc_count++;if(10===this.calc_count||a)this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1);if(this.coords.w_rs){this.calcPointer();this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100); +a=100-this.coords.p_handle;var b=this.toFixed(this.coords.p_pointer-this.coords.p_gap);"click"===this.target&&(b=this.toFixed(this.coords.p_pointer-this.coords.p_handle/2),this.target=this.chooseHandle(b));0>b?b=0:b>a&&(b=a);switch(this.target){case "base":b=(this.options.max-this.options.min)/100;a=(this.result.from-this.options.min)/b;b=(this.result.to-this.options.min)/b;this.coords.p_single_real=this.toFixed(a);this.coords.p_from_real=this.toFixed(a);this.coords.p_to_real=this.toFixed(b);this.coords.p_single_real= +this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_single=this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_from=this.toFixed(a-this.coords.p_handle/100*a);this.coords.p_to=this.toFixed(b-this.coords.p_handle/100*b);this.target= +null;break;case "single":if(this.options.from_fixed)break;this.coords.p_single_real=this.calcWithStep(b/a*100);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_single=this.toFixed(this.coords.p_single_real/100*a);break;case "from":if(this.options.from_fixed)break;this.coords.p_from_real=this.calcWithStep(b/a*100);this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real);this.coords.p_from_real= +this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from=this.toFixed(this.coords.p_from_real/100*a);break;case "to":if(this.options.to_fixed)break;this.coords.p_to_real=this.calcWithStep(b/a*100);this.coords.p_to_realthis.coords.x_pointer? +this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},chooseHandle:function(a){return"single"===this.options.type?"single":a>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/ +this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single+this.coords.p_handle/2-this.labels.p_single/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from+this.coords.p_handle/ +2-this.labels.p_from/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to+this.coords.p_handle/2-this.labels.p_to/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to),this.labels.w_single= +this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to)/2-this.labels.p_single/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left)),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single))},updateScene:function(){this.options&&(this.drawHandles(),this.raf_id=requestAnimationFrame(this.updateScene.bind(this)))},drawHandles:function(){this.coords.w_rs= +this.$cache.rs.outerWidth(!1);if(this.coords.w_rs){this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0);if(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow();if(this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)){if(this.old_from!==this.result.from||this.old_to!== +this.result.to||this.force_redraw||this.is_key){this.drawLabels();this.$cache.bar[0].style.left=this.coords.p_bar_x+"%";this.$cache.bar[0].style.width=this.coords.p_bar_w+"%";if("single"===this.options.type)this.$cache.s_single[0].style.left=this.coords.p_single+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value),this.$cache.input.data("from",this.result.from_value)):(this.$cache.input.prop("value",this.result.from), +this.$cache.input.data("from",this.result.from));else{this.$cache.s_from[0].style.left=this.coords.p_from+"%";this.$cache.s_to[0].style.left=this.coords.p_to+"%";if(this.old_from!==this.result.from||this.force_redraw)this.$cache.from[0].style.left=this.labels.p_from_left+"%";if(this.old_to!==this.result.to||this.force_redraw)this.$cache.to[0].style.left=this.labels.p_to_left+"%";this.$cache.single[0].style.left=this.labels.p_single_left+"%";this.options.values.length?(this.$cache.input.prop("value", +this.result.from_value+";"+this.result.to_value),this.$cache.input.data("from",this.result.from_value),this.$cache.input.data("to",this.result.to_value)):(this.$cache.input.prop("value",this.result.from+";"+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))}this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||this.$cache.input.trigger("change");this.old_from=this.result.from;this.old_to=this.result.to;if(this.options.onChange&& +"function"===typeof this.options.onChange&&!this.is_resize&&!this.is_update&&!this.is_start)this.options.onChange(this.result);if(this.options.onFinish&&"function"===typeof this.options.onFinish&&(this.is_key||this.is_click))this.options.onFinish(this.result);this.is_resize=this.is_update=!1}this.force_redraw=this.is_click=this.is_key=this.is_start=!1}}},drawLabels:function(){if(this.options){var a=this.options.values.length,b=this.options.p_values,c;if(!this.options.hide_from_to)if("single"===this.options.type)a= +a?this.decorate(b[this.result.from]):this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a),this.calcLabels(),this.$cache.min[0].style.visibility=this.labels.p_single_left100-this.labels.p_max-1?"hidden":"visible";else{a?(this.options.decorate_both?(a=this.decorate(b[this.result.from]),a+=this.options.values_separator,a+=this.decorate(b[this.result.to])): +a=this.decorate(b[this.result.from]+this.options.values_separator+b[this.result.to]),c=this.decorate(b[this.result.from]),b=this.decorate(b[this.result.to])):(this.options.decorate_both?(a=this.decorate(this._prettify(this.result.from)),a+=this.options.values_separator,a+=this.decorate(this._prettify(this.result.to))):a=this.decorate(this._prettify(this.result.from)+this.options.values_separator+this._prettify(this.result.to),this.result.from),c=this.decorate(this._prettify(this.result.from),this.result.from), +b=this.decorate(this._prettify(this.result.to),this.result.to));this.$cache.single.html(a);this.$cache.from.html(c);this.$cache.to.html(b);this.calcLabels();b=Math.min(this.labels.p_single_left,this.labels.p_from_left);a=this.labels.p_single_left+this.labels.p_single;c=this.labels.p_to_left+this.labels.p_to;var d=Math.max(a,c);this.labels.p_from_left+this.labels.p_from>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility= +"visible",this.result.from===this.result.to?(this.$cache.from[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden",d=c):(this.$cache.from[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",d=Math.max(a,c))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden");this.$cache.min[0].style.visibility=b100-this.labels.p_max-1?"hidden":"visible"}}},drawShadow:function(){var a=this.options,b=this.$cache,c,d;"single"===a.type?a.from_shadow&&(a.from_min||a.from_max)?(c=this.calcPercent(a.from_min||a.min),d=this.calcPercent(a.from_max||a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,b.shad_single[0].style.display="block",b.shad_single[0].style.left=c+"%",b.shad_single[0].style.width=d+"%"):b.shad_single[0].style.display="none": +(a.from_shadow&&(a.from_min||a.from_max)?(c=this.calcPercent(a.from_min||a.min),d=this.calcPercent(a.from_max||a.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,b.shad_from[0].style.display="block",b.shad_from[0].style.left=c+"%",b.shad_from[0].style.width=d+"%"):b.shad_from[0].style.display="none",a.to_shadow&&(a.to_min||a.to_max)?(c=this.calcPercent(a.to_min||a.min),a=this.calcPercent(a.to_max||a.max)-c,c=this.toFixed(c- +this.coords.p_handle/100*c),a=this.toFixed(a-this.coords.p_handle/100*a),c+=this.coords.p_handle/2,b.shad_to[0].style.display="block",b.shad_to[0].style.left=c+"%",b.shad_to[0].style.width=a+"%"):b.shad_to[0].style.display="none")},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input")},calcPercent:function(a){return this.toFixed((a-this.options.min)/((this.options.max-this.options.min)/100))},calcReal:function(a){var b=this.options.min,c=this.options.max,d=0;0>b&&(d=Math.abs(b), +b+=d,c+=d);a=(c-b)/100*a+b;(b=this.options.step.toString().split(".")[1])?a=+a.toFixed(b.length):(a/=this.options.step,a*=this.options.step,a=+a.toFixed(0));d&&(a-=d);athis.options.max&&(a=this.options.max);return b?+a.toFixed(b.length):this.toFixed(a)},calcWithStep:function(a){var b=Math.round(a/this.coords.p_step)*this.coords.p_step;100d.max_interval&&(a=b-d.max_interval):a-b>d.max_interval&&(a=b+d.max_interval);return this.calcPercent(a)},checkDiapason:function(a,b,c){a=this.calcReal(a);var d=this.options;b&&"number"===typeof b||(b=d.min);c&& +"number"===typeof c||(c=d.max);ac&&(a=c);return this.calcPercent(a)},toFixed:function(a){a=a.toFixed(5);return+a},_prettify:function(a){return this.options.prettify_enabled?this.options.prettify&&"function"===typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},prettify:function(a){return a.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(a,b){if(!this.options.force_edges)return this.toFixed(a);0>a?a=0: +a>100-b&&(a=100-b);return this.toFixed(a)},validate:function(){var a=this.options,b=this.result,c=a.values,d=c.length,h,f;"string"===typeof a.min&&(a.min=+a.min);"string"===typeof a.max&&(a.max=+a.max);"string"===typeof a.from&&(a.from=+a.from);"string"===typeof a.to&&(a.to=+a.to);"string"===typeof a.step&&(a.step=+a.step);"string"===typeof a.from_min&&(a.from_min=+a.from_min);"string"===typeof a.from_max&&(a.from_max=+a.from_max);"string"===typeof a.to_min&&(a.to_min=+a.to_min);"string"===typeof a.to_max&& +(a.to_max=+a.to_max);"string"===typeof a.keyboard_step&&(a.keyboard_step=+a.keyboard_step);"string"===typeof a.grid_num&&(a.grid_num=+a.grid_num);a.max<=a.min&&(a.max=a.min?2*a.min:a.min+1,a.step=1);if(d)for(a.p_values=[],a.min=0,a.max=d-1,a.step=1,a.grid_num=a.max,a.grid_snap=!0,f=0;fa.max)a.from= +a.min;if(a.to>a.max||a.toa.to&&(a.from=a.to);if("number"!==typeof a.step||isNaN(a.step)||!a.step||0>a.step)a.step=1;if("number"!==typeof a.keyboard_step||isNaN(a.keyboard_step)||!a.keyboard_step||0>a.keyboard_step)a.keyboard_step=5;a.from_min&&a.froma.from_max&&(a.from=a.from_max);a.to_min&&a.toa.to_max&&(a.to=a.to_max);if(b){b.min!==a.min&&(b.min=a.min);b.max!== +a.max&&(b.max=a.max);if(b.fromb.max)b.from=a.from;if(b.tob.max)b.to=a.to}if("number"!==typeof a.min_interval||isNaN(a.min_interval)||!a.min_interval||0>a.min_interval)a.min_interval=0;if("number"!==typeof a.max_interval||isNaN(a.max_interval)||!a.max_interval||0>a.max_interval)a.max_interval=0;a.min_interval&&a.min_interval>a.max-a.min&&(a.min_interval=a.max-a.min);a.max_interval&&a.max_interval>a.max-a.min&&(a.max_interval=a.max-a.min)},decorate:function(a,b){var c="", +d=this.options;d.prefix&&(c+=d.prefix);c+=a;d.max_postfix&&(d.values.length&&a===d.p_values[d.max]?(c+=d.max_postfix,d.postfix&&(c+=" ")):b===d.max&&(c+=d.max_postfix,d.postfix&&(c+=" ")));d.postfix&&(c+=d.postfix);return c},updateFrom:function(){this.result.from=this.options.from;this.result.from_percent=this.calcPercent(this.result.from);this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to;this.result.to_percent= +this.calcPercent(this.result.to);this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(){this.result.min=this.options.min;this.result.max=this.options.max;this.updateFrom();this.updateTo()},appendGrid:function(){if(this.options.grid){var a=this.options,b,c;b=a.max-a.min;var d=a.grid_num,h=0,f=0,k=4,e,g,l=0,m="";this.calcGridMargin();a.grid_snap?(d=b/a.step,h=this.toFixed(a.step/(b/100))):h=this.toFixed(100/d);4e&&(e=0));this.coords.big[b]=f;g=(f-h*(b-1))/(e+1);for(c=1;c<=e&&0!==f;c++)l=this.toFixed(f-g*c),m+='';m+='';l=this.calcReal(f);l=a.values.length?a.p_values[l]:this._prettify(l);m+=''+l+""}this.coords.big_num=Math.ceil(d+1);this.$cache.cont.addClass("irs-with-grid"); +this.$cache.grid.html(m);this.cacheGridLabels()}},cacheGridLabels:function(){var a,b,c=this.coords.big_num;for(b=0;b100-this.coords.grid_gap&&(c[d-1]=100-this.coords.grid_gap,b[d-1]=this.toFixed(c[d-1]-this.coords.big_p[d-1]),this.coords.big_x[d-1]=this.toFixed(this.coords.big_p[d-1]-this.coords.grid_gap)));this.calcGridCollision(2, +b,c);this.calcGridCollision(4,b,c);for(a=0;a=k)break;f=this.$cache.grid_labels[e][0];f.style.visibility=c[d]<=b[e]?"visible":"hidden"}},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1): +this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(a){this.is_update=!0;this.options.from=this.result.from;this.options.to=this.result.to;this.options=e.extend(this.options,a);this.validate();this.updateResult(a);this.toggleInput(); +this.remove();this.init(!0)},reset:function(){this.updateResult();this.update()},destroy:function(){this.toggleInput();this.$cache.input.prop("readonly",!1);e.data(this.input,"ionRangeSlider",null);this.remove();this.options=this.input=null}};e.fn.ionRangeSlider=function(a){return this.each(function(){e.data(this,"ionRangeSlider")||e.data(this,"ionRangeSlider",new p(this,a,t++))})};(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c English description | Описание на русском Easy and light range slider * Project page and demos -* Download ion.rangeSlider-2.0.2.zip +* Download ion.rangeSlider-2.0.3.zip *** @@ -469,6 +469,7 @@ All plugins options are covered in demos. ## Update history +* 2.0.3: December 29, 2014 - Issues fixed: #160, #165, #166, #168, #170 * 2.0.2: December 02, 2014 - Issues fixed: #143, #148, #153, #155, #159. API update. * 2.0.1: November 15, 2014 - Some bugs fixed and few new methods. * 2.0.0: November 08, 2014 - New API, lot's of bug fixes and improvements. diff --git a/readme.ru.md b/readme.ru.md index 0d643e1..7eef11e 100644 --- a/readme.ru.md +++ b/readme.ru.md @@ -1,10 +1,10 @@ -# Ion.Range Slider 2.0.2 +# Ion.Range Slider 2.0.3 > English description | Описание на русском Удобный легкий слайдер диапазонов * Страница проекта и демо -* Download ion.rangeSlider-2.0.2.zip +* Download ion.rangeSlider-2.0.3.zip *** @@ -469,6 +469,7 @@ slider.destroy(); ## История обновлений +* 2.0.3: 29.12.2014 - Выполнены задачи: #160, #165, #166, #168, #170 * 2.0.2: 02.12.2014 - Выполнены задачи: #143, #148, #153, #155, #159. Обновление API. * 2.0.1: 15.11.2014 - Исправлено несколько багов, доавлена пара новых методов. * 2.0.0: 08.11.2014 - Новый API. Внесено множество улучшений и исправлено множество багов.