materialize-sass 1.0.0.beta → 1.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/assets/javascripts/materialize.js +277 -195
- data/assets/javascripts/materialize/autocomplete.js +94 -37
- data/assets/javascripts/materialize/buttons.js +4 -6
- data/assets/javascripts/materialize/carousel.js +7 -7
- data/assets/javascripts/materialize/collapsible.js +0 -2
- data/assets/javascripts/materialize/datepicker.js +27 -44
- data/assets/javascripts/materialize/dropdown.js +29 -9
- data/assets/javascripts/materialize/extras/nouislider.js +1 -1
- data/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
- data/assets/javascripts/materialize/forms.js +4 -4
- data/assets/javascripts/materialize/global.js +26 -11
- data/assets/javascripts/materialize/materialbox.js +6 -6
- data/assets/javascripts/materialize/modal.js +8 -4
- data/assets/javascripts/materialize/parallax.js +1 -1
- data/assets/javascripts/materialize/range.js +2 -19
- data/assets/javascripts/materialize/select.js +22 -23
- data/assets/javascripts/materialize/sidenav.js +3 -2
- data/assets/javascripts/materialize/slider.js +2 -1
- data/assets/javascripts/materialize/tabs.js +3 -3
- data/assets/javascripts/materialize/timepicker.js +22 -5
- data/assets/javascripts/materialize/toasts.js +4 -3
- data/assets/javascripts/materialize/tooltip.js +8 -3
- data/assets/stylesheets/materialize/components/_buttons.scss +2 -1
- data/assets/stylesheets/materialize/components/_collapsible.scss +7 -0
- data/assets/stylesheets/materialize/components/_datepicker.scss +4 -0
- data/assets/stylesheets/materialize/components/_dropdown.scss +10 -1
- data/assets/stylesheets/materialize/components/_sidenav.scss +1 -1
- data/assets/stylesheets/materialize/components/_toast.scss +0 -1
- data/assets/stylesheets/materialize/components/_variables.scss +1 -0
- data/assets/stylesheets/materialize/components/forms/_input-fields.scss +2 -0
- data/assets/stylesheets/materialize/components/forms/_range.scss +3 -3
- data/assets/stylesheets/materialize/components/forms/_select.scss +6 -4
- data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
- data/lib/materialize-sass/version.rb +1 -1
- metadata +3 -3
@@ -24,7 +24,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
24
24
|
onOpenStart: null,
|
25
25
|
onOpenEnd: null,
|
26
26
|
onCloseStart: null,
|
27
|
-
onCloseEnd: null
|
27
|
+
onCloseEnd: null,
|
28
|
+
onItemClick: null
|
28
29
|
};
|
29
30
|
|
30
31
|
/**
|
@@ -97,6 +98,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
97
98
|
_this._resetFilterQueryBound = _this._resetFilterQuery.bind(_this);
|
98
99
|
_this._handleDocumentClickBound = _this._handleDocumentClick.bind(_this);
|
99
100
|
_this._handleDocumentTouchmoveBound = _this._handleDocumentTouchmove.bind(_this);
|
101
|
+
_this._handleDropdownClickBound = _this._handleDropdownClick.bind(_this);
|
100
102
|
_this._handleDropdownKeydownBound = _this._handleDropdownKeydown.bind(_this);
|
101
103
|
_this._handleTriggerKeydownBound = _this._handleTriggerKeydown.bind(_this);
|
102
104
|
_this._setupEventHandlers();
|
@@ -127,6 +129,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
127
129
|
// Trigger keydown handler
|
128
130
|
this.el.addEventListener('keydown', this._handleTriggerKeydownBound);
|
129
131
|
|
132
|
+
// Item click handler
|
133
|
+
this.dropdownEl.addEventListener('click', this._handleDropdownClickBound);
|
134
|
+
|
130
135
|
// Hover event handlers
|
131
136
|
if (this.options.hover) {
|
132
137
|
this._handleMouseEnterBound = this._handleMouseEnter.bind(this);
|
@@ -149,13 +154,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
149
154
|
}, {
|
150
155
|
key: '_removeEventHandlers',
|
151
156
|
value: function _removeEventHandlers() {
|
152
|
-
// Trigger keydown handler
|
153
157
|
this.el.removeEventListener('keydown', this._handleTriggerKeydownBound);
|
158
|
+
this.dropdownEl.removeEventListener('click', this._handleDropdownClickBound);
|
154
159
|
|
155
160
|
if (this.options.hover) {
|
156
|
-
this.el.
|
157
|
-
this.el.
|
158
|
-
this.dropdownEl.
|
161
|
+
this.el.removeEventListener('mouseenter', this._handleMouseEnterBound);
|
162
|
+
this.el.removeEventListener('mouseleave', this._handleMouseLeaveBound);
|
163
|
+
this.dropdownEl.removeEventListener('mouseleave', this._handleMouseLeaveBound);
|
159
164
|
} else {
|
160
165
|
this.el.removeEventListener('click', this._handleClickBound);
|
161
166
|
}
|
@@ -248,6 +253,21 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
248
253
|
}
|
249
254
|
}
|
250
255
|
|
256
|
+
/**
|
257
|
+
* Handle Dropdown Click
|
258
|
+
* @param {Event} e
|
259
|
+
*/
|
260
|
+
|
261
|
+
}, {
|
262
|
+
key: '_handleDropdownClick',
|
263
|
+
value: function _handleDropdownClick(e) {
|
264
|
+
// onItemClick callback
|
265
|
+
if (typeof this.options.onItemClick === 'function') {
|
266
|
+
var itemEl = $(e.target).closest('li')[0];
|
267
|
+
this.options.onItemClick.call(this, itemEl);
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
251
271
|
/**
|
252
272
|
* Handle Dropdown Keydown
|
253
273
|
* @param {Event} e
|
@@ -455,8 +475,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
455
475
|
value: [0, 1],
|
456
476
|
easing: 'easeOutQuad'
|
457
477
|
},
|
458
|
-
scaleX: [.3, 1],
|
459
|
-
scaleY: [.3, 1],
|
478
|
+
scaleX: [0.3, 1],
|
479
|
+
scaleY: [0.3, 1],
|
460
480
|
duration: this.options.inDuration,
|
461
481
|
easing: 'easeOutQuint',
|
462
482
|
complete: function (anim) {
|
@@ -489,8 +509,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
489
509
|
value: 0,
|
490
510
|
easing: 'easeOutQuint'
|
491
511
|
},
|
492
|
-
scaleX: .3,
|
493
|
-
scaleY: .3,
|
512
|
+
scaleX: 0.3,
|
513
|
+
scaleY: 0.3,
|
494
514
|
duration: this.options.outDuration,
|
495
515
|
easing: 'easeOutQuint',
|
496
516
|
complete: function (anim) {
|
@@ -1 +1 @@
|
|
1
|
-
!function(){function t(t){return t.split("").reverse().join("")}function e(t,e,n){if((t[e]||t[n])&&t[e]===t[n])throw Error(e)}function n(e,n,r,i,o,s,a,u,l,c,f,p){a=p;var d,h=f="";return s&&(p=s(p)),!("number"!=typeof p||!isFinite(p))&&(e&&0===parseFloat(p.toFixed(e))&&(p=0),0>p&&(d=!0,p=Math.abs(p)),e&&(s=Math.pow(10,e),p=(Math.round(p*s)/s).toFixed(e)),-1!==(p=p.toString()).indexOf(".")&&(e=p.split("."),p=e[0],r&&(f=r+e[1])),n&&(p=t(p).match(/.{1,3}/g),p=t(p.join(t(n)))),d&&u&&(h+=u),i&&(h+=i),d&&l&&(h+=l),h=h+p+f,o&&(h+=o),c&&(h=c(h,a)),h)}function r(t,e,n,r,i,o,s,a,u,l,c,f){var p;return t="",c&&(f=c(f)),!(!f||"string"!=typeof f)&&(a&&f.substring(0,a.length)===a&&(f=f.replace(a,""),p=!0),r&&f.substring(0,r.length)===r&&(f=f.replace(r,"")),u&&f.substring(0,u.length)===u&&(f=f.replace(u,""),p=!0),i&&f.slice(-1*i.length)===i&&(f=f.slice(0,-1*i.length)),e&&(f=f.split(e).join("")),n&&(f=f.replace(n,".")),p&&(t+="-"),t=Number((t+f).replace(/[^0-9\.\-.]/g,"")),s&&(t=s(t)),!("number"!=typeof t||!isFinite(t))&&t)}function i(t){var n,r,i,o={};for(n=0;n<a.length;n+=1)r=a[n],void 0===(i=t[r])?o[r]="negative"!==r||o.negativeBefore?"mark"===r&&"."!==o.thousand&&".":"-":"decimals"===r?0<i&&8>i&&(o[r]=i):"encoder"===r||"decoder"===r||"edit"===r||"undo"===r?"function"==typeof i&&(o[r]=i):"string"==typeof i&&(o[r]=i);return e(o,"mark","thousand"),e(o,"prefix","negative"),e(o,"prefix","negativeBefore"),o}function o(t,e,n){var r,i=[];for(r=0;r<a.length;r+=1)i.push(t[a[r]]);return i.push(n),e.apply("",i)}function s(t){if(!(this instanceof s))return new s(t);"object"==typeof t&&(t=i(t),this.to=function(e){return o(t,n,e)},this.from=function(e){return o(t,r,e)})}var a="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=s}(),function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}(function(){"use strict";function t(t,e){var n=document.createElement("div");return l(n,e),t.appendChild(n),n}function e(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}function n(t,e){return Math.round(t/e)*e}function r(t,e){var n=t.getBoundingClientRect(),r=t.ownerDocument.documentElement,i=p();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(i.x=0),e?n.top+i.y-r.clientTop:n.left+i.x-r.clientLeft}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function o(t,e,n){n>0&&(l(t,e),setTimeout(function(){c(t,e)},n))}function s(t){return Math.max(Math.min(t,100),0)}function a(t){return Array.isArray(t)?t:[t]}function u(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function l(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function c(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function p(){var t=void 0!==window.pageXOffset,e="CSS1Compat"===(document.compatMode||"");return{x:t?window.pageXOffset:e?document.documentElement.scrollLeft:document.body.scrollLeft,y:t?window.pageYOffset:e?document.documentElement.scrollTop:document.body.scrollTop}}function d(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function h(t,e){return 100/(e-t)}function m(t,e){return 100*e/(t[1]-t[0])}function g(t,e){return m(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}function v(t,e){return e*(t[1]-t[0])/100+t[0]}function b(t,e){for(var n=1;t>=e[n];)n+=1;return n}function w(t,e,n){if(n>=t.slice(-1)[0])return 100;var r,i,o,s,a=b(n,t);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],o+g([r,i],n)/h(o,s)}function S(t,e,n){if(n>=100)return t.slice(-1)[0];var r,i,o,s,a=b(n,e);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],v([r,i],(n-o)*h(o,s))}function x(t,e,r,i){if(100===i)return i;var o,s,a=b(i,t);return r?(o=t[a-1],s=t[a],i-o>(s-o)/2?s:o):e[a-1]?t[a-1]+n(i-t[a-1],e[a-1]):i}function y(t,e,n){var r;if("number"==typeof e&&(e=[e]),"[object Array]"!==Object.prototype.toString.call(e))throw new Error("noUiSlider: 'range' contains invalid value.");if(r="min"===t?0:"max"===t?100:parseFloat(t),!i(r)||!i(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");n.xPct.push(r),n.xVal.push(e[0]),r?n.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(n.xSteps[0]=e[1]),n.xHighestCompleteStep.push(0)}function E(t,e,n){if(!e)return!0;n.xSteps[t]=m([n.xVal[t],n.xVal[t+1]],e)/h(n.xPct[t],n.xPct[t+1]);var r=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*i;n.xHighestCompleteStep[t]=o}function C(t,e,n,r){this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e,this.direction=n;var i,o=[];for(i in t)t.hasOwnProperty(i)&&o.push([t[i],i]);for(o.length&&"object"==typeof o[0][0]?o.sort(function(t,e){return t[0][0]-e[0][0]}):o.sort(function(t,e){return t[0]-e[0]}),i=0;i<o.length;i++)y(o[i][1],o[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)E(i,this.xNumSteps[i],this)}function N(t,e){if(!i(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function U(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");t.spectrum=new C(e,t.snap,t.dir,t.singleStep)}function M(t,e){if(e=a(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function P(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function k(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function O(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function V(t,e){var n,r=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n<t.handles;n++)r.push(e);r.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");r=e}t.connect=r}function A(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function L(t,e){if(!i(e))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function F(t,e){if(!i(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function j(t,e){if(!i(e))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==e){if(t.padding=t.spectrum.getMargin(e),!t.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(t.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(t.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function z(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function H(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var n=e.indexOf("tap")>=0,r=e.indexOf("drag")>=0,i=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,s=e.indexOf("hover")>=0;if(i){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");L(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:r,fixed:i,snap:o,hover:s}}function D(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=a(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function T(t,e){if(t.format=e,"function"==typeof e.to&&"function"==typeof e.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function q(t,e){if(void 0!==e&&"string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function R(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix){t.cssClasses={};for(var n in e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n])}else t.cssClasses=e}function B(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function X(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:I},n={step:{r:!1,t:N},start:{r:!0,t:M},connect:{r:!0,t:V},direction:{r:!0,t:z},snap:{r:!1,t:P},animate:{r:!1,t:k},animationDuration:{r:!1,t:O},range:{r:!0,t:U},orientation:{r:!1,t:A},margin:{r:!1,t:L},limit:{r:!1,t:F},padding:{r:!1,t:j},behaviour:{r:!0,t:H},format:{r:!1,t:T},tooltips:{r:!1,t:D},cssPrefix:{r:!1,t:q},cssClasses:{r:!1,t:R},useRequestAnimationFrame:{r:!1,t:B}},r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleTouchArea:"handle-touch-area",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(n).forEach(function(i){if(void 0===t[i]&&void 0===r[i]){if(n[i].r)throw new Error("noUiSlider: '"+i+"' is required.");return!0}n[i].t(e,void 0===t[i]?r[i]:t[i])}),e.pips=t.pips;var i=[["left","top"],["right","bottom"]];return e.style=i[e.dir][e.ort],e.styleOposite=i[e.dir?0:1][e.ort],e}function Y(n,i,u){function h(e,n){var r=t(e,i.cssClasses.origin),o=t(r,i.cssClasses.handle);return t(o,i.cssClasses.handleTouchArea),o.setAttribute("data-handle",n),0===n?l(o,i.cssClasses.handleLower):n===i.handles-1&&l(o,i.cssClasses.handleUpper),r}function m(e,n){return!!n&&t(e,i.cssClasses.connect)}function g(e,n){return!!i.tooltips[n]&&t(e.firstChild,i.cssClasses.tooltip)}function v(t,e,n){if("range"===t||"steps"===t)return tt.xVal;if("count"===t){var r,i=100/(e-1),o=0;for(e=[];(r=o++*i)<=100;)e.push(r);t="positions"}return"positions"===t?e.map(function(t){return tt.fromStepping(n?tt.getStep(t):t)}):"values"===t?n?e.map(function(t){return tt.fromStepping(tt.getStep(tt.toStepping(t)))}):e:void 0}function b(t,n,r){function i(t,e){return(t+e).toFixed(7)/1}var o={},s=tt.xVal[0],a=tt.xVal[tt.xVal.length-1],u=!1,l=!1,c=0;return(r=e(r.slice().sort(function(t,e){return t-e})))[0]!==s&&(r.unshift(s),u=!0),r[r.length-1]!==a&&(r.push(a),l=!0),r.forEach(function(e,s){var a,f,p,d,h,m,g,v,b,w=e,S=r[s+1];if("steps"===n&&(a=tt.xNumSteps[s]),a||(a=S-w),!1!==w&&void 0!==S)for(a=Math.max(a,1e-7),f=w;f<=S;f=i(f,a)){for(g=(h=(d=tt.toStepping(f))-c)/t,b=h/(v=Math.round(g)),p=1;p<=v;p+=1)o[(c+p*b).toFixed(5)]=["x",0];m=r.indexOf(f)>-1?1:"steps"===n?2:0,!s&&u&&(m=0),f===S&&l||(o[d.toFixed(5)]=[f,m]),c=d}}),o}function w(t,e,n){function r(t,e){var n=e===i.cssClasses.value,r=n?p:d,o=n?c:f;return e+" "+r[i.ort]+" "+o[t]}function o(t,e,n){return'class="'+r(n[1],e)+'" style="'+i.style+": "+t+'%"'}function s(t,r){r[1]=r[1]&&e?e(r[0],r[1]):r[1],u+="<div "+o(t,i.cssClasses.marker,r)+"></div>",r[1]&&(u+="<div "+o(t,i.cssClasses.value,r)+">"+n.to(r[0])+"</div>")}var a=document.createElement("div"),u="",c=[i.cssClasses.valueNormal,i.cssClasses.valueLarge,i.cssClasses.valueSub],f=[i.cssClasses.markerNormal,i.cssClasses.markerLarge,i.cssClasses.markerSub],p=[i.cssClasses.valueHorizontal,i.cssClasses.valueVertical],d=[i.cssClasses.markerHorizontal,i.cssClasses.markerVertical];return l(a,i.cssClasses.pips),l(a,0===i.ort?i.cssClasses.pipsHorizontal:i.cssClasses.pipsVertical),Object.keys(t).forEach(function(e){s(e,t[e])}),a.innerHTML=u,a}function S(t){var e=t.mode,n=t.density||1,r=t.filter||!1,i=b(n,e,v(e,t.values||!1,t.stepped||!1)),o=t.format||{to:Math.round};return J.appendChild(w(i,r,o))}function x(){var t=I.getBoundingClientRect(),e="offset"+["Width","Height"][i.ort];return 0===i.ort?t.width||I[e]:t.height||I[e]}function y(t,e,n,r){var o=function(e){return!J.hasAttribute("disabled")&&(!f(J,i.cssClasses.tap)&&(!!(e=E(e,r.pageOffset))&&(!(t===G.start&&void 0!==e.buttons&&e.buttons>1)&&((!r.hover||!e.buttons)&&(e.calcPoint=e.points[i.ort],void n(e,r))))))},s=[];return t.split(" ").forEach(function(t){e.addEventListener(t,o,!1),s.push([t,o])}),s}function E(t,e){t.preventDefault();var n,r,i=0===t.type.indexOf("touch"),o=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");if(0===t.type.indexOf("MSPointer")&&(s=!0),i){if(t.touches.length>1)return!1;n=t.changedTouches[0].pageX,r=t.changedTouches[0].pageY}return e=e||p(),(o||s)&&(n=t.clientX+e.x,r=t.clientY+e.y),t.pageOffset=e,t.points=[n,r],t.cursor=o||s,t}function C(t){var e=100*(t-r(I,i.ort))/x();return i.dir?100-e:e}function N(t){var e=100,n=!1;return _.forEach(function(r,i){if(!r.hasAttribute("disabled")){var o=Math.abs(K[i]-t);o<e&&(n=i,e=o)}}),n}function U(t,e,n,r){var i=n.slice(),o=[!t,t],s=[t,!t];r=r.slice(),t&&r.reverse(),r.length>1?r.forEach(function(t,n){var r=F(i,t,i[t]+e,o[n],s[n]);!1===r?e=0:(e=r-i[t],i[t]=r)}):o=s=[!0];var a=!1;r.forEach(function(t,r){a=D(t,n[t]+e,o[r],s[r])||a}),a&&r.forEach(function(t){M("update",t),M("slide",t)})}function M(t,e,n){Object.keys(nt).forEach(function(r){var o=r.split(".")[0];t===o&&nt[r].forEach(function(t){t.call($,et.map(i.format.to),e,et.slice(),n||!1,K.slice())})})}function P(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&O(t,e)}function k(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return O(t,e);var n=(i.dir?-1:1)*(t.calcPoint-e.startCalcPoint);U(n>0,100*n/e.baseSize,e.locations,e.handleNumbers)}function O(t,e){Z&&(c(Z,i.cssClasses.active),Z=!1),t.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach(function(t){document.documentElement.removeEventListener(t[0],t[1])}),c(J,i.cssClasses.drag),H(),e.handleNumbers.forEach(function(t){M("set",t),M("change",t),M("end",t)})}function V(t,e){if(1===e.handleNumbers.length){var n=_[e.handleNumbers[0]];if(n.hasAttribute("disabled"))return!1;l(Z=n.children[0],i.cssClasses.active)}t.preventDefault(),t.stopPropagation();var r=y(G.move,document.documentElement,k,{startCalcPoint:t.calcPoint,baseSize:x(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:K.slice()}),o=y(G.end,document.documentElement,O,{handleNumbers:e.handleNumbers}),s=y("mouseout",document.documentElement,P,{handleNumbers:e.handleNumbers});if(document.documentElement.noUiListeners=r.concat(o,s),t.cursor){document.body.style.cursor=getComputedStyle(t.target).cursor,_.length>1&&l(J,i.cssClasses.drag);var a=function(){return!1};document.body.noUiListener=a,document.body.addEventListener("selectstart",a,!1)}e.handleNumbers.forEach(function(t){M("start",t)})}function A(t){t.stopPropagation();var e=C(t.calcPoint),n=N(e);if(!1===n)return!1;i.events.snap||o(J,i.cssClasses.tap,i.animationDuration),D(n,e,!0,!0),H(),M("slide",n,!0),M("set",n,!0),M("change",n,!0),M("update",n,!0),i.events.snap&&V(t,{handleNumbers:[n]})}function L(t){var e=C(t.calcPoint),n=tt.getStep(e),r=tt.fromStepping(n);Object.keys(nt).forEach(function(t){"hover"===t.split(".")[0]&&nt[t].forEach(function(t){t.call($,r)})})}function F(t,e,n,r,o){return _.length>1&&(r&&e>0&&(n=Math.max(n,t[e-1]+i.margin)),o&&e<_.length-1&&(n=Math.min(n,t[e+1]-i.margin))),_.length>1&&i.limit&&(r&&e>0&&(n=Math.min(n,t[e-1]+i.limit)),o&&e<_.length-1&&(n=Math.max(n,t[e+1]-i.limit))),i.padding&&(0===e&&(n=Math.max(n,i.padding)),e===_.length-1&&(n=Math.min(n,100-i.padding))),n=tt.getStep(n),(n=s(n))!==t[e]&&n}function j(t){return t+"%"}function z(t,e){K[t]=e,et[t]=tt.fromStepping(e);var n=function(){_[t].style[i.style]=j(e),T(t),T(t+1)};window.requestAnimationFrame&&i.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}function H(){Q.forEach(function(t){var e=K[t]>50?-1:1,n=3+(_.length+e*t);_[t].childNodes[0].style.zIndex=n})}function D(t,e,n,r){return!1!==(e=F(K,t,e,n,r))&&(z(t,e),!0)}function T(t){if(W[t]){var e=0,n=100;0!==t&&(e=K[t-1]),t!==W.length-1&&(n=K[t]),W[t].style[i.style]=j(e),W[t].style[i.styleOposite]=j(100-n)}}function q(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=i.format.from(t))||isNaN(t)||D(e,tt.toStepping(t),!1,!1))}function R(t,e){var n=a(t),r=void 0===K[0];e=void 0===e||!!e,n.forEach(q),i.animate&&!r&&o(J,i.cssClasses.tap,i.animationDuration),Q.forEach(function(t){D(t,K[t],!0,!1)}),H(),Q.forEach(function(t){M("update",t),null!==n[t]&&e&&M("set",t)})}function B(){var t=et.map(i.format.to);return 1===t.length?t[0]:t}function Y(t,e){nt[t]=nt[t]||[],nt[t].push(e),"update"===t.split(".")[0]&&_.forEach(function(t,e){M("update",e)})}var I,_,W,$,G=d(),J=n,K=[],Q=[],Z=!1,tt=i.spectrum,et=[],nt={};if(J.noUiSlider)throw new Error("Slider was already initialized.");return function(e){l(e,i.cssClasses.target),0===i.dir?l(e,i.cssClasses.ltr):l(e,i.cssClasses.rtl),0===i.ort?l(e,i.cssClasses.horizontal):l(e,i.cssClasses.vertical),I=t(e,i.cssClasses.base)}(J),function(t,e){_=[],(W=[]).push(m(e,t[0]));for(var n=0;n<i.handles;n++)_.push(h(e,n)),Q[n]=n,W.push(m(e,t[n+1]))}(i.connect,I),$={destroy:function(){for(var t in i.cssClasses)i.cssClasses.hasOwnProperty(t)&&c(J,i.cssClasses[t]);for(;J.firstChild;)J.removeChild(J.firstChild);delete J.noUiSlider},steps:function(){return K.map(function(t,e){var n=tt.getNearbySteps(t),r=et[e],i=n.thisStep.step,o=null;!1!==i&&r+i>n.stepAfter.startValue&&(i=n.stepAfter.startValue-r),o=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===t?i=null:0===t&&(o=null);var s=tt.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,i]})},on:Y,off:function(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(nt).forEach(function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete nt[t]})},get:B,set:R,reset:function(t){R(i.start,t)},__moveHandles:function(t,e,n){U(t,e,K,n)},options:u,updateOptions:function(t,e){var n=B(),r=["margin","limit","padding","range","animate","snap","step","format"];r.forEach(function(e){void 0!==t[e]&&(u[e]=t[e])});var o=X(u);r.forEach(function(e){void 0!==t[e]&&(i[e]=o[e])}),o.spectrum.direction=tt.direction,tt=o.spectrum,i.margin=o.margin,i.limit=o.limit,i.padding=o.padding,K=[],R(t.start||n,e)},target:J,pips:S},function(t){t.fixed||_.forEach(function(t,e){y(G.start,t.children[0],V,{handleNumbers:[e]})}),t.tap&&y(G.start,I,A,{}),t.hover&&y(G.move,I,L,{hover:!0}),t.drag&&W.forEach(function(e,n){if(!1!==e&&0!==n&&n!==W.length-1){var r=_[n-1],o=_[n],s=[e];l(e,i.cssClasses.draggable),t.fixed&&(s.push(r.children[0]),s.push(o.children[0])),s.forEach(function(t){y(G.start,t,V,{handles:[r,o],handleNumbers:[n-1,n]})})}})}(i.events),R(i.start),i.pips&&S(i.pips),i.tooltips&&function(){var t=_.map(g);Y("update",function(e,n,r){if(t[n]){var o=e[n];!0!==i.tooltips[n]&&(o=i.tooltips[n].to(r[n])),t[n].innerHTML="<span>"+o+"</span>"}})}(),$}C.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&m(this.xVal,t)},C.prototype.toStepping=function(t){return t=w(this.xVal,this.xPct,t)},C.prototype.fromStepping=function(t){return S(this.xVal,this.xPct,t)},C.prototype.getStep=function(t){return t=x(this.xPct,this.xSteps,this.snap,t)},C.prototype.getNearbySteps=function(t){var e=b(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},C.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(u);return Math.max.apply(null,t)},C.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var I={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};return{create:function(t,e){if(!t.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===e.tooltips&&(e.tooltips=!0);var n=Y(t,X(e,t),e);return t.noUiSlider=n,n}}});
|
1
|
+
!function(){function t(t){return t.split("").reverse().join("")}function e(t,e,n){if((t[e]||t[n])&&t[e]===t[n])throw Error(e)}function n(e,n,r,i,o,s,a,u,l,c,f,p){a=p;var d,h=f="";return s&&(p=s(p)),!("number"!=typeof p||!isFinite(p))&&(e&&0===parseFloat(p.toFixed(e))&&(p=0),0>p&&(d=!0,p=Math.abs(p)),e&&(s=Math.pow(10,e),p=(Math.round(p*s)/s).toFixed(e)),-1!==(p=p.toString()).indexOf(".")&&(e=p.split("."),p=e[0],r&&(f=r+e[1])),n&&(p=t(p).match(/.{1,3}/g),p=t(p.join(t(n)))),d&&u&&(h+=u),i&&(h+=i),d&&l&&(h+=l),h=h+p+f,o&&(h+=o),c&&(h=c(h,a)),h)}function r(t,e,n,r,i,o,s,a,u,l,c,f){var p;return t="",c&&(f=c(f)),!(!f||"string"!=typeof f)&&(a&&f.substring(0,a.length)===a&&(f=f.replace(a,""),p=!0),r&&f.substring(0,r.length)===r&&(f=f.replace(r,"")),u&&f.substring(0,u.length)===u&&(f=f.replace(u,""),p=!0),i&&f.slice(-1*i.length)===i&&(f=f.slice(0,-1*i.length)),e&&(f=f.split(e).join("")),n&&(f=f.replace(n,".")),p&&(t+="-"),t=Number((t+f).replace(/[^0-9\.\-.]/g,"")),s&&(t=s(t)),!("number"!=typeof t||!isFinite(t))&&t)}function i(t){var n,r,i,o={};for(n=0;n<a.length;n+=1)r=a[n],i=t[r],void 0===i?o[r]="negative"!==r||o.negativeBefore?"mark"===r&&"."!==o.thousand&&".":"-":"decimals"===r?0<i&&8>i&&(o[r]=i):"encoder"===r||"decoder"===r||"edit"===r||"undo"===r?"function"==typeof i&&(o[r]=i):"string"==typeof i&&(o[r]=i);return e(o,"mark","thousand"),e(o,"prefix","negative"),e(o,"prefix","negativeBefore"),o}function o(t,e,n){var r,i=[];for(r=0;r<a.length;r+=1)i.push(t[a[r]]);return i.push(n),e.apply("",i)}function s(t){if(!(this instanceof s))return new s(t);"object"==typeof t&&(t=i(t),this.to=function(e){return o(t,n,e)},this.from=function(e){return o(t,r,e)})}var a="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=s}(),function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}(function(){"use strict";function t(t,e){var n=document.createElement("div");return l(n,e),t.appendChild(n),n}function e(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}function n(t,e){return Math.round(t/e)*e}function r(t,e){var n=t.getBoundingClientRect(),r=t.ownerDocument.documentElement,i=p();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(i.x=0),e?n.top+i.y-r.clientTop:n.left+i.x-r.clientLeft}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function o(t,e,n){n>0&&(l(t,e),setTimeout(function(){c(t,e)},n))}function s(t){return Math.max(Math.min(t,100),0)}function a(t){return Array.isArray(t)?t:[t]}function u(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function l(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function c(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function p(){var t=void 0!==window.pageXOffset,e="CSS1Compat"===(document.compatMode||"");return{x:t?window.pageXOffset:e?document.documentElement.scrollLeft:document.body.scrollLeft,y:t?window.pageYOffset:e?document.documentElement.scrollTop:document.body.scrollTop}}function d(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function h(t,e){return 100/(e-t)}function m(t,e){return 100*e/(t[1]-t[0])}function g(t,e){return m(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}function v(t,e){return e*(t[1]-t[0])/100+t[0]}function b(t,e){for(var n=1;t>=e[n];)n+=1;return n}function w(t,e,n){if(n>=t.slice(-1)[0])return 100;var r,i,o,s,a=b(n,t);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],o+g([r,i],n)/h(o,s)}function S(t,e,n){if(n>=100)return t.slice(-1)[0];var r,i,o,s,a=b(n,e);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],v([r,i],(n-o)*h(o,s))}function x(t,e,r,i){if(100===i)return i;var o,s,a=b(i,t);return r?(o=t[a-1],s=t[a],i-o>(s-o)/2?s:o):e[a-1]?t[a-1]+n(i-t[a-1],e[a-1]):i}function y(t,e,n){var r;if("number"==typeof e&&(e=[e]),"[object Array]"!==Object.prototype.toString.call(e))throw new Error("noUiSlider: 'range' contains invalid value.");if(r="min"===t?0:"max"===t?100:parseFloat(t),!i(r)||!i(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");n.xPct.push(r),n.xVal.push(e[0]),r?n.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(n.xSteps[0]=e[1]),n.xHighestCompleteStep.push(0)}function E(t,e,n){if(!e)return!0;n.xSteps[t]=m([n.xVal[t],n.xVal[t+1]],e)/h(n.xPct[t],n.xPct[t+1]);var r=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*i;n.xHighestCompleteStep[t]=o}function C(t,e,n,r){this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e,this.direction=n;var i,o=[];for(i in t)t.hasOwnProperty(i)&&o.push([t[i],i]);for(o.length&&"object"==typeof o[0][0]?o.sort(function(t,e){return t[0][0]-e[0][0]}):o.sort(function(t,e){return t[0]-e[0]}),i=0;i<o.length;i++)y(o[i][1],o[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)E(i,this.xNumSteps[i],this)}function N(t,e){if(!i(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function U(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");t.spectrum=new C(e,t.snap,t.dir,t.singleStep)}function M(t,e){if(e=a(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function P(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function k(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function O(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function V(t,e){var n,r=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n<t.handles;n++)r.push(e);r.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");r=e}t.connect=r}function A(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function L(t,e){if(!i(e))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function F(t,e){if(!i(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function j(t,e){if(!i(e))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==e){if(t.padding=t.spectrum.getMargin(e),!t.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(t.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(t.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function z(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function H(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var n=e.indexOf("tap")>=0,r=e.indexOf("drag")>=0,i=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,s=e.indexOf("hover")>=0;if(i){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");L(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:r,fixed:i,snap:o,hover:s}}function D(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=a(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function T(t,e){if(t.format=e,"function"==typeof e.to&&"function"==typeof e.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function q(t,e){if(void 0!==e&&"string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function R(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix){t.cssClasses={};for(var n in e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n])}else t.cssClasses=e}function B(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function X(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:I},n={step:{r:!1,t:N},start:{r:!0,t:M},connect:{r:!0,t:V},direction:{r:!0,t:z},snap:{r:!1,t:P},animate:{r:!1,t:k},animationDuration:{r:!1,t:O},range:{r:!0,t:U},orientation:{r:!1,t:A},margin:{r:!1,t:L},limit:{r:!1,t:F},padding:{r:!1,t:j},behaviour:{r:!0,t:H},format:{r:!1,t:T},tooltips:{r:!1,t:D},cssPrefix:{r:!1,t:q},cssClasses:{r:!1,t:R},useRequestAnimationFrame:{r:!1,t:B}},r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleTouchArea:"handle-touch-area",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(n).forEach(function(i){if(void 0===t[i]&&void 0===r[i]){if(n[i].r)throw new Error("noUiSlider: '"+i+"' is required.");return!0}n[i].t(e,void 0===t[i]?r[i]:t[i])}),e.pips=t.pips;var i=[["left","top"],["right","bottom"]];return e.style=i[e.dir][e.ort],e.styleOposite=i[e.dir?0:1][e.ort],e}function Y(n,i,u){function h(e,n){var r=t(e,i.cssClasses.origin),o=t(r,i.cssClasses.handle);return t(o,i.cssClasses.handleTouchArea),o.setAttribute("data-handle",n),0===n?l(o,i.cssClasses.handleLower):n===i.handles-1&&l(o,i.cssClasses.handleUpper),r}function m(e,n){return!!n&&t(e,i.cssClasses.connect)}function g(e,n){return!!i.tooltips[n]&&t(e.firstChild,i.cssClasses.tooltip)}function v(t,e,n){if("range"===t||"steps"===t)return tt.xVal;if("count"===t){var r,i=100/(e-1),o=0;for(e=[];(r=o++*i)<=100;)e.push(r);t="positions"}return"positions"===t?e.map(function(t){return tt.fromStepping(n?tt.getStep(t):t)}):"values"===t?n?e.map(function(t){return tt.fromStepping(tt.getStep(tt.toStepping(t)))}):e:void 0}function b(t,n,r){function i(t,e){return(t+e).toFixed(7)/1}var o={},s=tt.xVal[0],a=tt.xVal[tt.xVal.length-1],u=!1,l=!1,c=0;return(r=e(r.slice().sort(function(t,e){return t-e})))[0]!==s&&(r.unshift(s),u=!0),r[r.length-1]!==a&&(r.push(a),l=!0),r.forEach(function(e,s){var a,f,p,d,h,m,g,v,b,w=e,S=r[s+1];if("steps"===n&&(a=tt.xNumSteps[s]),a||(a=S-w),!1!==w&&void 0!==S)for(a=Math.max(a,1e-7),f=w;f<=S;f=i(f,a)){for(g=(h=(d=tt.toStepping(f))-c)/t,b=h/(v=Math.round(g)),p=1;p<=v;p+=1)o[(c+p*b).toFixed(5)]=["x",0];m=r.indexOf(f)>-1?1:"steps"===n?2:0,!s&&u&&(m=0),f===S&&l||(o[d.toFixed(5)]=[f,m]),c=d}}),o}function w(t,e,n){function r(t,e){var n=e===i.cssClasses.value,r=n?p:d,o=n?c:f;return e+" "+r[i.ort]+" "+o[t]}function o(t,e,n){return'class="'+r(n[1],e)+'" style="'+i.style+": "+t+'%"'}function s(t,r){r[1]=r[1]&&e?e(r[0],r[1]):r[1],u+="<div "+o(t,i.cssClasses.marker,r)+"></div>",r[1]&&(u+="<div "+o(t,i.cssClasses.value,r)+">"+n.to(r[0])+"</div>")}var a=document.createElement("div"),u="",c=[i.cssClasses.valueNormal,i.cssClasses.valueLarge,i.cssClasses.valueSub],f=[i.cssClasses.markerNormal,i.cssClasses.markerLarge,i.cssClasses.markerSub],p=[i.cssClasses.valueHorizontal,i.cssClasses.valueVertical],d=[i.cssClasses.markerHorizontal,i.cssClasses.markerVertical];return l(a,i.cssClasses.pips),l(a,0===i.ort?i.cssClasses.pipsHorizontal:i.cssClasses.pipsVertical),Object.keys(t).forEach(function(e){s(e,t[e])}),a.innerHTML=u,a}function S(t){var e=t.mode,n=t.density||1,r=t.filter||!1,i=b(n,e,v(e,t.values||!1,t.stepped||!1)),o=t.format||{to:Math.round};return J.appendChild(w(i,r,o))}function x(){var t=I.getBoundingClientRect(),e="offset"+["Width","Height"][i.ort];return 0===i.ort?t.width||I[e]:t.height||I[e]}function y(t,e,n,r){var o=function(e){return!J.hasAttribute("disabled")&&(!f(J,i.cssClasses.tap)&&(!!(e=E(e,r.pageOffset))&&(!(t===G.start&&void 0!==e.buttons&&e.buttons>1)&&((!r.hover||!e.buttons)&&(e.calcPoint=e.points[i.ort],void n(e,r))))))},s=[];return t.split(" ").forEach(function(t){e.addEventListener(t,o,!1),s.push([t,o])}),s}function E(t,e){t.preventDefault();var n,r,i=0===t.type.indexOf("touch"),o=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");if(0===t.type.indexOf("MSPointer")&&(s=!0),i){if(t.touches.length>1)return!1;n=t.changedTouches[0].pageX,r=t.changedTouches[0].pageY}return e=e||p(),(o||s)&&(n=t.clientX+e.x,r=t.clientY+e.y),t.pageOffset=e,t.points=[n,r],t.cursor=o||s,t}function C(t){var e=100*(t-r(I,i.ort))/x();return i.dir?100-e:e}function N(t){var e=100,n=!1;return _.forEach(function(r,i){if(!r.hasAttribute("disabled")){var o=Math.abs(K[i]-t);o<e&&(n=i,e=o)}}),n}function U(t,e,n,r){var i=n.slice(),o=[!t,t],s=[t,!t];r=r.slice(),t&&r.reverse(),r.length>1?r.forEach(function(t,n){var r=F(i,t,i[t]+e,o[n],s[n]);!1===r?e=0:(e=r-i[t],i[t]=r)}):o=s=[!0];var a=!1;r.forEach(function(t,r){a=D(t,n[t]+e,o[r],s[r])||a}),a&&r.forEach(function(t){M("update",t),M("slide",t)})}function M(t,e,n){Object.keys(nt).forEach(function(r){var o=r.split(".")[0];t===o&&nt[r].forEach(function(t){t.call($,et.map(i.format.to),e,et.slice(),n||!1,K.slice())})})}function P(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&O(t,e)}function k(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return O(t,e);var n=(i.dir?-1:1)*(t.calcPoint-e.startCalcPoint);U(n>0,100*n/e.baseSize,e.locations,e.handleNumbers)}function O(t,e){Z&&(c(Z,i.cssClasses.active),Z=!1),t.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach(function(t){document.documentElement.removeEventListener(t[0],t[1])}),c(J,i.cssClasses.drag),H(),e.handleNumbers.forEach(function(t){M("set",t),M("change",t),M("end",t)})}function V(t,e){if(1===e.handleNumbers.length){var n=_[e.handleNumbers[0]];if(n.hasAttribute("disabled"))return!1;l(Z=n.children[0],i.cssClasses.active)}t.preventDefault(),t.stopPropagation();var r=y(G.move,document.documentElement,k,{startCalcPoint:t.calcPoint,baseSize:x(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:K.slice()}),o=y(G.end,document.documentElement,O,{handleNumbers:e.handleNumbers}),s=y("mouseout",document.documentElement,P,{handleNumbers:e.handleNumbers});if(document.documentElement.noUiListeners=r.concat(o,s),t.cursor){document.body.style.cursor=getComputedStyle(t.target).cursor,_.length>1&&l(J,i.cssClasses.drag);var a=function(){return!1};document.body.noUiListener=a,document.body.addEventListener("selectstart",a,!1)}e.handleNumbers.forEach(function(t){M("start",t)})}function A(t){t.stopPropagation();var e=C(t.calcPoint),n=N(e);if(!1===n)return!1;i.events.snap||o(J,i.cssClasses.tap,i.animationDuration),D(n,e,!0,!0),H(),M("slide",n,!0),M("set",n,!0),M("change",n,!0),M("update",n,!0),i.events.snap&&V(t,{handleNumbers:[n]})}function L(t){var e=C(t.calcPoint),n=tt.getStep(e),r=tt.fromStepping(n);Object.keys(nt).forEach(function(t){"hover"===t.split(".")[0]&&nt[t].forEach(function(t){t.call($,r)})})}function F(t,e,n,r,o){return _.length>1&&(r&&e>0&&(n=Math.max(n,t[e-1]+i.margin)),o&&e<_.length-1&&(n=Math.min(n,t[e+1]-i.margin))),_.length>1&&i.limit&&(r&&e>0&&(n=Math.min(n,t[e-1]+i.limit)),o&&e<_.length-1&&(n=Math.max(n,t[e+1]-i.limit))),i.padding&&(0===e&&(n=Math.max(n,i.padding)),e===_.length-1&&(n=Math.min(n,100-i.padding))),n=tt.getStep(n),(n=s(n))!==t[e]&&n}function j(t){return t+"%"}function z(t,e){K[t]=e,et[t]=tt.fromStepping(e);var n=function(){_[t].style[i.style]=j(e),T(t),T(t+1)};window.requestAnimationFrame&&i.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}function H(){Q.forEach(function(t){var e=K[t]>50?-1:1,n=3+(_.length+e*t);_[t].childNodes[0].style.zIndex=n})}function D(t,e,n,r){return!1!==(e=F(K,t,e,n,r))&&(z(t,e),!0)}function T(t){if(W[t]){var e=0,n=100;0!==t&&(e=K[t-1]),t!==W.length-1&&(n=K[t]),W[t].style[i.style]=j(e),W[t].style[i.styleOposite]=j(100-n)}}function q(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=i.format.from(t))||isNaN(t)||D(e,tt.toStepping(t),!1,!1))}function R(t,e){var n=a(t),r=void 0===K[0];e=void 0===e||!!e,n.forEach(q),i.animate&&!r&&o(J,i.cssClasses.tap,i.animationDuration),Q.forEach(function(t){D(t,K[t],!0,!1)}),H(),Q.forEach(function(t){M("update",t),null!==n[t]&&e&&M("set",t)})}function B(){var t=et.map(i.format.to);return 1===t.length?t[0]:t}function Y(t,e){nt[t]=nt[t]||[],nt[t].push(e),"update"===t.split(".")[0]&&_.forEach(function(t,e){M("update",e)})}var I,_,W,$,G=d(),J=n,K=[],Q=[],Z=!1,tt=i.spectrum,et=[],nt={};if(J.noUiSlider)throw new Error("Slider was already initialized.");return function(e){l(e,i.cssClasses.target),0===i.dir?l(e,i.cssClasses.ltr):l(e,i.cssClasses.rtl),0===i.ort?l(e,i.cssClasses.horizontal):l(e,i.cssClasses.vertical),I=t(e,i.cssClasses.base)}(J),function(t,e){_=[],(W=[]).push(m(e,t[0]));for(var n=0;n<i.handles;n++)_.push(h(e,n)),Q[n]=n,W.push(m(e,t[n+1]))}(i.connect,I),$={destroy:function(){for(var t in i.cssClasses)i.cssClasses.hasOwnProperty(t)&&c(J,i.cssClasses[t]);for(;J.firstChild;)J.removeChild(J.firstChild);delete J.noUiSlider},steps:function(){return K.map(function(t,e){var n=tt.getNearbySteps(t),r=et[e],i=n.thisStep.step,o=null;!1!==i&&r+i>n.stepAfter.startValue&&(i=n.stepAfter.startValue-r),o=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===t?i=null:0===t&&(o=null);var s=tt.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,i]})},on:Y,off:function(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(nt).forEach(function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete nt[t]})},get:B,set:R,reset:function(t){R(i.start,t)},__moveHandles:function(t,e,n){U(t,e,K,n)},options:u,updateOptions:function(t,e){var n=B(),r=["margin","limit","padding","range","animate","snap","step","format"];r.forEach(function(e){void 0!==t[e]&&(u[e]=t[e])});var o=X(u);r.forEach(function(e){void 0!==t[e]&&(i[e]=o[e])}),o.spectrum.direction=tt.direction,tt=o.spectrum,i.margin=o.margin,i.limit=o.limit,i.padding=o.padding,K=[],R(t.start||n,e)},target:J,pips:S},function(t){t.fixed||_.forEach(function(t,e){y(G.start,t.children[0],V,{handleNumbers:[e]})}),t.tap&&y(G.start,I,A,{}),t.hover&&y(G.move,I,L,{hover:!0}),t.drag&&W.forEach(function(e,n){if(!1!==e&&0!==n&&n!==W.length-1){var r=_[n-1],o=_[n],s=[e];l(e,i.cssClasses.draggable),t.fixed&&(s.push(r.children[0]),s.push(o.children[0])),s.forEach(function(t){y(G.start,t,V,{handles:[r,o],handleNumbers:[n-1,n]})})}})}(i.events),R(i.start),i.pips&&S(i.pips),i.tooltips&&function(){var t=_.map(g);Y("update",function(e,n,r){if(t[n]){var o=e[n];!0!==i.tooltips[n]&&(o=i.tooltips[n].to(r[n])),t[n].innerHTML="<span>"+o+"</span>"}})}(),$}C.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&m(this.xVal,t)},C.prototype.toStepping=function(t){return t=w(this.xVal,this.xPct,t)},C.prototype.fromStepping=function(t){return S(this.xVal,this.xPct,t)},C.prototype.getStep=function(t){return t=x(this.xPct,this.xSteps,this.snap,t)},C.prototype.getNearbySteps=function(t){var e=b(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},C.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(u);return Math.max.apply(null,t)},C.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var I={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};return{create:function(t,e){if(!t.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===e.tooltips&&(e.tooltips=!0);var n=Y(t,X(e,t),e);return t.noUiSlider=n,n}}});
|
@@ -45,7 +45,7 @@
|
|
45
45
|
}
|
46
46
|
|
47
47
|
if (!$textarea.length) {
|
48
|
-
console.error(
|
48
|
+
console.error('No textarea element found');
|
49
49
|
return;
|
50
50
|
}
|
51
51
|
|
@@ -186,10 +186,10 @@
|
|
186
186
|
document.addEventListener('blur', function (e) {
|
187
187
|
var $inputElement = $(e.target);
|
188
188
|
if ($inputElement.is(input_selector)) {
|
189
|
-
var selector =
|
189
|
+
var selector = '.prefix';
|
190
190
|
|
191
191
|
if ($inputElement[0].value.length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === null) {
|
192
|
-
selector +=
|
192
|
+
selector += ', label';
|
193
193
|
}
|
194
194
|
$inputElement.siblings(selector).removeClass('active');
|
195
195
|
M.validate_field($inputElement);
|
@@ -238,7 +238,7 @@
|
|
238
238
|
for (var i = 0; i < files.length; i++) {
|
239
239
|
file_names.push(files[i].name);
|
240
240
|
}
|
241
|
-
path_input[0].value = file_names.join(
|
241
|
+
path_input[0].value = file_names.join(', ');
|
242
242
|
path_input.trigger('change');
|
243
243
|
});
|
244
244
|
}); // End of $(document).ready
|
@@ -11,8 +11,8 @@
|
|
11
11
|
})(window);
|
12
12
|
|
13
13
|
// AMD
|
14
|
-
if (typeof define ===
|
15
|
-
define(
|
14
|
+
if (typeof define === 'function' && define.amd) {
|
15
|
+
define('M', [], function () {
|
16
16
|
return M;
|
17
17
|
});
|
18
18
|
|
@@ -36,18 +36,31 @@ M.keys = {
|
|
36
36
|
* TabPress Keydown handler
|
37
37
|
*/
|
38
38
|
M.tabPressed = false;
|
39
|
+
M.keyDown = false;
|
39
40
|
var docHandleKeydown = function (e) {
|
40
|
-
|
41
|
+
M.keyDown = true;
|
42
|
+
if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) {
|
41
43
|
M.tabPressed = true;
|
42
44
|
}
|
43
45
|
};
|
44
46
|
var docHandleKeyup = function (e) {
|
45
|
-
|
47
|
+
M.keyDown = false;
|
48
|
+
if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) {
|
46
49
|
M.tabPressed = false;
|
47
50
|
}
|
48
51
|
};
|
49
|
-
|
50
|
-
|
52
|
+
var docHandleFocus = function (e) {
|
53
|
+
if (M.keyDown) {
|
54
|
+
document.body.classList.add('keyboard-focused');
|
55
|
+
}
|
56
|
+
};
|
57
|
+
var docHandleBlur = function (e) {
|
58
|
+
document.body.classList.remove('keyboard-focused');
|
59
|
+
};
|
60
|
+
document.addEventListener('keydown', docHandleKeydown, true);
|
61
|
+
document.addEventListener('keyup', docHandleKeyup, true);
|
62
|
+
document.addEventListener('focus', docHandleFocus, true);
|
63
|
+
document.addEventListener('blur', docHandleBlur, true);
|
51
64
|
|
52
65
|
/**
|
53
66
|
* Initialize jQuery wrapper for plugin
|
@@ -80,7 +93,7 @@ M.initializeJqueryWrapper = function (plugin, pluginName, classRef) {
|
|
80
93
|
}
|
81
94
|
|
82
95
|
// Return error if an unrecognized method name is passed in
|
83
|
-
jQuery.error(
|
96
|
+
jQuery.error('Method ' + methodOrOptions + ' does not exist on jQuery.' + pluginName);
|
84
97
|
};
|
85
98
|
};
|
86
99
|
|
@@ -147,7 +160,7 @@ M.guid = function () {
|
|
147
160
|
* @returns {string}
|
148
161
|
*/
|
149
162
|
M.escapeHash = function (hash) {
|
150
|
-
return hash.replace(/(:|\.|\[|\]|,|=|\/)/g,
|
163
|
+
return hash.replace(/(:|\.|\[|\]|,|=|\/)/g, '\\$1');
|
151
164
|
};
|
152
165
|
|
153
166
|
M.elementOrParentIsFixed = function (element) {
|
@@ -155,7 +168,7 @@ M.elementOrParentIsFixed = function (element) {
|
|
155
168
|
var $checkElements = $element.add($element.parents());
|
156
169
|
var isFixed = false;
|
157
170
|
$checkElements.each(function () {
|
158
|
-
if ($(this).css(
|
171
|
+
if ($(this).css('position') === 'fixed') {
|
159
172
|
isFixed = true;
|
160
173
|
return false;
|
161
174
|
}
|
@@ -195,6 +208,8 @@ M.checkWithinContainer = function (container, bounding, offset) {
|
|
195
208
|
};
|
196
209
|
|
197
210
|
var containerRect = container.getBoundingClientRect();
|
211
|
+
// If body element is smaller than viewport, use viewport height instead.
|
212
|
+
var containerBottom = container === document.body ? Math.max(containerRect.bottom, window.innerHeight) : containerRect.bottom;
|
198
213
|
|
199
214
|
var scrollLeft = container.scrollLeft;
|
200
215
|
var scrollTop = container.scrollTop;
|
@@ -215,7 +230,7 @@ M.checkWithinContainer = function (container, bounding, offset) {
|
|
215
230
|
edges.top = true;
|
216
231
|
}
|
217
232
|
|
218
|
-
if (scrolledY + bounding.height >
|
233
|
+
if (scrolledY + bounding.height > containerBottom - offset || scrolledY + bounding.height > window.innerHeight - offset) {
|
219
234
|
edges.bottom = true;
|
220
235
|
}
|
221
236
|
|
@@ -298,7 +313,7 @@ M.getIdFromTrigger = function (trigger) {
|
|
298
313
|
if (id) {
|
299
314
|
id = id.slice(1);
|
300
315
|
} else {
|
301
|
-
id =
|
316
|
+
id = '';
|
302
317
|
}
|
303
318
|
}
|
304
319
|
return id;
|
@@ -59,7 +59,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
59
59
|
_this.originalWidth = 0;
|
60
60
|
_this.originalHeight = 0;
|
61
61
|
_this.originInlineStyles = _this.$el.attr('style');
|
62
|
-
_this.caption = _this.el.getAttribute('data-caption') ||
|
62
|
+
_this.caption = _this.el.getAttribute('data-caption') || '';
|
63
63
|
|
64
64
|
// Wrap
|
65
65
|
_this.$el.before(_this.placeholder);
|
@@ -284,7 +284,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
284
284
|
value: function _updateVars() {
|
285
285
|
this.windowWidth = window.innerWidth;
|
286
286
|
this.windowHeight = window.innerHeight;
|
287
|
-
this.caption = this.el.getAttribute('data-caption') ||
|
287
|
+
this.caption = this.el.getAttribute('data-caption') || '';
|
288
288
|
}
|
289
289
|
|
290
290
|
/**
|
@@ -373,14 +373,14 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
373
373
|
});
|
374
374
|
|
375
375
|
// Add and animate caption if it exists
|
376
|
-
if (this.caption !==
|
376
|
+
if (this.caption !== '') {
|
377
377
|
if (this.$photocaption) {
|
378
378
|
anim.remove(this.$photoCaption[0]);
|
379
379
|
}
|
380
380
|
this.$photoCaption = $('<div class="materialbox-caption"></div>');
|
381
381
|
this.$photoCaption.text(this.caption);
|
382
382
|
$('body').append(this.$photoCaption);
|
383
|
-
this.$photoCaption.css({
|
383
|
+
this.$photoCaption.css({ display: 'inline' });
|
384
384
|
|
385
385
|
anim({
|
386
386
|
targets: this.$photoCaption[0],
|
@@ -439,7 +439,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
439
439
|
anim.remove(this.el);
|
440
440
|
anim.remove(this.$overlay[0]);
|
441
441
|
|
442
|
-
if (this.caption !==
|
442
|
+
if (this.caption !== '') {
|
443
443
|
anim.remove(this.$photoCaption[0]);
|
444
444
|
}
|
445
445
|
|
@@ -462,7 +462,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
462
462
|
this._animateImageOut();
|
463
463
|
|
464
464
|
// Remove Caption + reset css settings on image
|
465
|
-
if (this.caption !==
|
465
|
+
if (this.caption !== '') {
|
466
466
|
anim({
|
467
467
|
targets: this.$photoCaption[0],
|
468
468
|
opacity: 0,
|
@@ -72,6 +72,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
72
72
|
_this._openingTrigger = undefined;
|
73
73
|
_this.$overlay = $('<div class="modal-overlay"></div>');
|
74
74
|
_this.el.tabIndex = 0;
|
75
|
+
_this._nthModalOpened = 0;
|
75
76
|
|
76
77
|
Modal._count++;
|
77
78
|
_this._setupEventHandlers();
|
@@ -191,7 +192,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
191
192
|
}, {
|
192
193
|
key: '_handleFocus',
|
193
194
|
value: function _handleFocus(e) {
|
194
|
-
if
|
195
|
+
// Only trap focus if this modal is the last model opened (prevents loops in nested modals).
|
196
|
+
if (!this.el.contains(e.target) && this._nthModalOpened === Modal._modalsOpen) {
|
195
197
|
this.el.focus();
|
196
198
|
}
|
197
199
|
}
|
@@ -249,8 +251,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
249
251
|
$.extend(enterAnimOptions, {
|
250
252
|
top: [this.options.startingTop, this.options.endingTop],
|
251
253
|
opacity: 1,
|
252
|
-
scaleX: [.8, 1],
|
253
|
-
scaleY: [.8, 1]
|
254
|
+
scaleX: [0.8, 1],
|
255
|
+
scaleY: [0.8, 1]
|
254
256
|
});
|
255
257
|
anim(enterAnimOptions);
|
256
258
|
}
|
@@ -324,6 +326,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
324
326
|
|
325
327
|
this.isOpen = true;
|
326
328
|
Modal._modalsOpen++;
|
329
|
+
this._nthModalOpened = Modal._modalsOpen;
|
327
330
|
|
328
331
|
// Set Z-Index based on number of currently open modals
|
329
332
|
this.$overlay[0].style.zIndex = 1000 + Modal._modalsOpen * 2;
|
@@ -374,6 +377,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
374
377
|
|
375
378
|
this.isOpen = false;
|
376
379
|
Modal._modalsOpen--;
|
380
|
+
this._nthModalOpened = 0;
|
377
381
|
|
378
382
|
// Call onCloseStart callback
|
379
383
|
if (typeof this.options.onCloseStart === 'function') {
|
@@ -389,7 +393,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
389
393
|
|
390
394
|
if (this.options.dismissible) {
|
391
395
|
document.removeEventListener('keydown', this._handleKeydownBound);
|
392
|
-
document.removeEventListener('focus', this._handleFocusBound);
|
396
|
+
document.removeEventListener('focus', this._handleFocusBound, true);
|
393
397
|
}
|
394
398
|
|
395
399
|
anim.remove(this.el);
|
@@ -36,7 +36,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
36
36
|
_this.$img = _this.$el.find('img').first();
|
37
37
|
_this.$img.each(function () {
|
38
38
|
var el = this;
|
39
|
-
if (el.complete) $(el).trigger(
|
39
|
+
if (el.complete) $(el).trigger('load');
|
40
40
|
});
|
41
41
|
|
42
42
|
_this._updateParallax();
|
@@ -70,14 +70,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
70
70
|
key: '_setupEventHandlers',
|
71
71
|
value: function _setupEventHandlers() {
|
72
72
|
this._handleRangeChangeBound = this._handleRangeChange.bind(this);
|
73
|
-
this._handleRangeFocusBound = this._handleRangeFocus.bind(this);
|
74
73
|
this._handleRangeMousedownTouchstartBound = this._handleRangeMousedownTouchstart.bind(this);
|
75
74
|
this._handleRangeInputMousemoveTouchmoveBound = this._handleRangeInputMousemoveTouchmove.bind(this);
|
76
75
|
this._handleRangeMouseupTouchendBound = this._handleRangeMouseupTouchend.bind(this);
|
77
76
|
this._handleRangeBlurMouseoutTouchleaveBound = this._handleRangeBlurMouseoutTouchleave.bind(this);
|
78
77
|
|
79
78
|
this.el.addEventListener('change', this._handleRangeChangeBound);
|
80
|
-
this.el.addEventListener('focus', this._handleRangeFocusBound);
|
81
79
|
|
82
80
|
this.el.addEventListener('mousedown', this._handleRangeMousedownTouchstartBound);
|
83
81
|
this.el.addEventListener('touchstart', this._handleRangeMousedownTouchstartBound);
|
@@ -102,7 +100,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
102
100
|
key: '_removeEventHandlers',
|
103
101
|
value: function _removeEventHandlers() {
|
104
102
|
this.el.removeEventListener('change', this._handleRangeChangeBound);
|
105
|
-
this.el.removeEventListener('focus', this._handleRangeFocusBound);
|
106
103
|
|
107
104
|
this.el.removeEventListener('mousedown', this._handleRangeMousedownTouchstartBound);
|
108
105
|
this.el.removeEventListener('touchstart', this._handleRangeMousedownTouchstartBound);
|
@@ -137,19 +134,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
137
134
|
$(this.thumb).addClass('active').css('left', offsetLeft + 'px');
|
138
135
|
}
|
139
136
|
|
140
|
-
/**
|
141
|
-
* Handle Range Focus
|
142
|
-
* @param {Event} e
|
143
|
-
*/
|
144
|
-
|
145
|
-
}, {
|
146
|
-
key: '_handleRangeFocus',
|
147
|
-
value: function _handleRangeFocus() {
|
148
|
-
if (M.tabPressed) {
|
149
|
-
this.$el.addClass('focused');
|
150
|
-
}
|
151
|
-
}
|
152
|
-
|
153
137
|
/**
|
154
138
|
* Handle Range Mousedown and Touchstart
|
155
139
|
* @param {Event} e
|
@@ -211,7 +195,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
211
195
|
key: '_handleRangeBlurMouseoutTouchleave',
|
212
196
|
value: function _handleRangeBlurMouseoutTouchleave() {
|
213
197
|
if (!this._mousedown) {
|
214
|
-
this.$el.removeClass('focused');
|
215
198
|
var paddingLeft = parseInt(this.$el.css('padding-left'));
|
216
199
|
var marginLeft = 7 + paddingLeft + 'px';
|
217
200
|
|
@@ -286,8 +269,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
286
269
|
key: '_calcRangeOffset',
|
287
270
|
value: function _calcRangeOffset() {
|
288
271
|
var width = this.$el.width() - 15;
|
289
|
-
var max = parseFloat(this.$el.attr('max'));
|
290
|
-
var min = parseFloat(this.$el.attr('min'));
|
272
|
+
var max = parseFloat(this.$el.attr('max')) || 100; // Range default max
|
273
|
+
var min = parseFloat(this.$el.attr('min')) || 0; // Range default min
|
291
274
|
var percent = (parseFloat(this.$el.val()) - min) / (max - min);
|
292
275
|
return percent * width;
|
293
276
|
}
|
@@ -142,17 +142,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
142
142
|
placeholderOption.find('input[type="checkbox"]').prop('checked', false);
|
143
143
|
this._toggleEntryFromArray(placeholderOption[0].id);
|
144
144
|
}
|
145
|
-
|
146
|
-
var checkbox = $(option).find('input[type="checkbox"]');
|
147
|
-
checkbox.prop('checked', !checkbox.prop('checked'));
|
148
145
|
selected = this._toggleEntryFromArray(key);
|
149
146
|
} else {
|
150
|
-
$(this.dropdownOptions).find('li').removeClass('
|
151
|
-
$(option).toggleClass('
|
152
|
-
this.input.value = option.textContent;
|
147
|
+
$(this.dropdownOptions).find('li').removeClass('selected');
|
148
|
+
$(option).toggleClass('selected', selected);
|
153
149
|
}
|
154
150
|
|
155
|
-
|
151
|
+
// Set selected on original select option
|
156
152
|
$(this._valueDict[key].el).prop('selected', selected);
|
157
153
|
this.$el.trigger('change');
|
158
154
|
}
|
@@ -183,7 +179,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
183
179
|
var _this4 = this;
|
184
180
|
|
185
181
|
this.wrapper = document.createElement('div');
|
186
|
-
$(this.wrapper).addClass('select-wrapper
|
182
|
+
$(this.wrapper).addClass('select-wrapper ' + this.options.classes);
|
187
183
|
this.$el.before($(this.wrapper));
|
188
184
|
this.wrapper.appendChild(this.el);
|
189
185
|
|
@@ -322,7 +318,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
322
318
|
|
323
319
|
// add icons
|
324
320
|
var iconUrl = option.getAttribute('data-icon');
|
325
|
-
var classes = option.getAttribute('class');
|
326
321
|
if (!!iconUrl) {
|
327
322
|
var imgEl = $('<img alt="" src="' + iconUrl + '">');
|
328
323
|
liEl.prepend(imgEl);
|
@@ -343,49 +338,54 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
343
338
|
key: '_toggleEntryFromArray',
|
344
339
|
value: function _toggleEntryFromArray(key) {
|
345
340
|
var notAdded = !this._keysSelected.hasOwnProperty(key);
|
341
|
+
var $optionLi = $(this._valueDict[key].optionEl);
|
342
|
+
|
346
343
|
if (notAdded) {
|
347
344
|
this._keysSelected[key] = true;
|
348
345
|
} else {
|
349
346
|
delete this._keysSelected[key];
|
350
347
|
}
|
351
348
|
|
352
|
-
$
|
349
|
+
$optionLi.toggleClass('selected', notAdded);
|
350
|
+
|
351
|
+
// Set checkbox checked value
|
352
|
+
$optionLi.find('input[type="checkbox"]').prop('checked', notAdded);
|
353
353
|
|
354
354
|
// use notAdded instead of true (to detect if the option is selected or not)
|
355
|
-
$
|
355
|
+
$optionLi.prop('selected', notAdded);
|
356
356
|
|
357
357
|
return notAdded;
|
358
358
|
}
|
359
359
|
|
360
360
|
/**
|
361
|
-
* Set value to input
|
361
|
+
* Set text value to input
|
362
362
|
*/
|
363
363
|
|
364
364
|
}, {
|
365
365
|
key: '_setValueToInput',
|
366
366
|
value: function _setValueToInput() {
|
367
|
-
var
|
367
|
+
var values = [];
|
368
368
|
var options = this.$el.find('option');
|
369
369
|
|
370
370
|
options.each(function (el) {
|
371
371
|
if ($(el).prop('selected')) {
|
372
372
|
var text = $(el).text();
|
373
|
-
|
373
|
+
values.push(text);
|
374
374
|
}
|
375
375
|
});
|
376
376
|
|
377
|
-
if (
|
377
|
+
if (!values.length) {
|
378
378
|
var firstDisabled = this.$el.find('option:disabled').eq(0);
|
379
|
-
if (firstDisabled.length) {
|
380
|
-
|
379
|
+
if (firstDisabled.length && firstDisabled[0].value === '') {
|
380
|
+
values.push(firstDisabled.text());
|
381
381
|
}
|
382
382
|
}
|
383
383
|
|
384
|
-
this.input.value =
|
384
|
+
this.input.value = values.join(', ');
|
385
385
|
}
|
386
386
|
|
387
387
|
/**
|
388
|
-
* Set selected state of dropdown
|
388
|
+
* Set selected state of dropdown to match actual select element
|
389
389
|
*/
|
390
390
|
|
391
391
|
}, {
|
@@ -395,12 +395,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
395
395
|
|
396
396
|
for (var key in this._valueDict) {
|
397
397
|
var option = this._valueDict[key];
|
398
|
-
|
399
|
-
|
398
|
+
var optionIsSelected = $(option.el).prop('selected');
|
399
|
+
$(option.optionEl).find('input[type="checkbox"]').prop('checked', optionIsSelected);
|
400
|
+
if (optionIsSelected) {
|
400
401
|
this._activateOption($(this.dropdownOptions), $(option.optionEl));
|
401
402
|
this._keysSelected[key] = true;
|
402
403
|
} else {
|
403
|
-
$(option.optionEl).find('input[type="checkbox"]').prop("checked", false);
|
404
404
|
$(option.optionEl).removeClass('selected');
|
405
405
|
}
|
406
406
|
}
|
@@ -419,7 +419,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
419
419
|
if (!this.isMultiple) {
|
420
420
|
collection.find('li.selected').removeClass('selected');
|
421
421
|
}
|
422
|
-
|
423
422
|
var option = $(newOption);
|
424
423
|
option.addClass('selected');
|
425
424
|
}
|