materialize-sass 0.97.8 → 0.98.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +1 -1
  4. data/app/assets/javascripts/materialize.js +5 -5
  5. data/app/assets/javascripts/materialize/animation.js +8 -9
  6. data/app/assets/javascripts/materialize/carousel.js +52 -25
  7. data/app/assets/javascripts/materialize/character_counter.js +2 -2
  8. data/app/assets/javascripts/materialize/chips.js +39 -10
  9. data/app/assets/javascripts/materialize/dropdown.js +12 -12
  10. data/app/assets/javascripts/materialize/extras/nouislider.js +1917 -1438
  11. data/app/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  12. data/app/assets/javascripts/materialize/forms.js +131 -35
  13. data/app/assets/javascripts/materialize/global.js +55 -0
  14. data/app/assets/javascripts/materialize/init.js +41 -4
  15. data/app/assets/javascripts/materialize/jquery.hammer.js +0 -0
  16. data/app/assets/javascripts/materialize/materialbox.js +86 -77
  17. data/app/assets/javascripts/materialize/modal.js +12 -12
  18. data/app/assets/javascripts/materialize/parallax.js +48 -48
  19. data/app/assets/javascripts/materialize/scrollFire.js +40 -37
  20. data/app/assets/javascripts/materialize/scrollspy.js +2 -53
  21. data/app/assets/javascripts/materialize/sideNav.js +46 -40
  22. data/app/assets/javascripts/materialize/slider.js +15 -12
  23. data/app/assets/javascripts/materialize/tabs.js +104 -35
  24. data/app/assets/javascripts/materialize/toasts.js +122 -123
  25. data/app/assets/javascripts/materialize/tooltip.js +15 -13
  26. data/app/assets/javascripts/materialize/transitions.js +24 -24
  27. data/app/assets/stylesheets/materialize.scss +2 -0
  28. data/app/assets/stylesheets/materialize/components/_badges.scss +46 -0
  29. data/app/assets/stylesheets/materialize/components/_buttons.scss +29 -17
  30. data/app/assets/stylesheets/materialize/components/_cards.scss +9 -3
  31. data/app/assets/stylesheets/materialize/components/_carousel.scss +1 -1
  32. data/app/assets/stylesheets/materialize/components/_collapsible.scss +3 -7
  33. data/app/assets/stylesheets/materialize/components/_global.scss +6 -62
  34. data/app/assets/stylesheets/materialize/components/_icons-material-design.scss +0 -0
  35. data/app/assets/stylesheets/materialize/components/_materialbox.scss +13 -12
  36. data/app/assets/stylesheets/materialize/components/_navbar.scss +26 -7
  37. data/app/assets/stylesheets/materialize/components/_prefixer.scss +0 -0
  38. data/app/assets/stylesheets/materialize/components/_sideNav.scss +8 -5
  39. data/app/assets/stylesheets/materialize/components/_table_of_contents.scss +2 -2
  40. data/app/assets/stylesheets/materialize/components/_tabs.scss +0 -0
  41. data/app/assets/stylesheets/materialize/components/_toast.scss +1 -1
  42. data/app/assets/stylesheets/materialize/components/_tooltip.scss +2 -3
  43. data/app/assets/stylesheets/materialize/components/_transitions.scss +13 -0
  44. data/app/assets/stylesheets/materialize/components/_typography.scss +0 -0
  45. data/app/assets/stylesheets/materialize/components/_variables.scss +7 -1
  46. data/app/assets/stylesheets/materialize/components/_waves.scss +80 -143
  47. data/app/assets/stylesheets/materialize/components/date_picker/_default.date.scss +0 -0
  48. data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +0 -0
  49. data/app/assets/stylesheets/materialize/components/date_picker/_default.time.scss +0 -0
  50. data/app/assets/stylesheets/materialize/components/forms/_input-fields.scss +4 -4
  51. data/app/assets/stylesheets/materialize/extras/nouislider.css +263 -123
  52. data/lib/materialize-sass/version.rb +1 -1
  53. metadata +4 -2
@@ -1 +1 @@
1
- !function(){function a(a){return a.split("").reverse().join("")}function b(a,b,c){if((a[b]||a[c])&&a[b]===a[c])throw Error(b)}function c(b,c,d,e,f,g,h,i,j,k,l,m){h=m;var n,o=l="";return g&&(m=g(m)),"number"==typeof m&&isFinite(m)?(b&&0===parseFloat(m.toFixed(b))&&(m=0),0>m&&(n=!0,m=Math.abs(m)),b&&(g=Math.pow(10,b),m=(Math.round(m*g)/g).toFixed(b)),m=m.toString(),-1!==m.indexOf(".")&&(b=m.split("."),m=b[0],d&&(l=d+b[1])),c&&(m=a(m).match(/.{1,3}/g),m=a(m.join(a(c)))),n&&i&&(o+=i),e&&(o+=e),n&&j&&(o+=j),o=o+m+l,f&&(o+=f),k&&(o=k(o,h)),o):!1}function d(a,b,c,d,e,f,g,h,i,j,k,l){var m;return a="",k&&(l=k(l)),l&&"string"==typeof l?(h&&l.substring(0,h.length)===h&&(l=l.replace(h,""),m=!0),d&&l.substring(0,d.length)===d&&(l=l.replace(d,"")),i&&l.substring(0,i.length)===i&&(l=l.replace(i,""),m=!0),e&&l.slice(-1*e.length)===e&&(l=l.slice(0,-1*e.length)),b&&(l=l.split(b).join("")),c&&(l=l.replace(c,".")),m&&(a+="-"),a=Number((a+l).replace(/[^0-9\.\-.]/g,"")),g&&(a=g(a)),"number"==typeof a&&isFinite(a)?a:!1):!1}function e(a){var c,d,e,f={};for(c=0;c<h.length;c+=1)d=h[c],e=a[d],void 0===e?f[d]="negative"!==d||f.negativeBefore?"mark"===d&&"."!==f.thousand?".":!1:"-":"decimals"===d?e>0&&8>e&&(f[d]=e):"encoder"===d||"decoder"===d||"edit"===d||"undo"===d?"function"==typeof e&&(f[d]=e):"string"==typeof e&&(f[d]=e);return b(f,"mark","thousand"),b(f,"prefix","negative"),b(f,"prefix","negativeBefore"),f}function f(a,b,c){var d,e=[];for(d=0;d<h.length;d+=1)e.push(a[h[d]]);return e.push(c),b.apply("",e)}function g(a){return this instanceof g?void("object"==typeof a&&(a=e(a),this.to=function(b){return f(a,c,b)},this.from=function(b){return f(a,d,b)})):new g(a)}var h="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=g}(),function(a){if("function"==typeof define&&define.amd)define([],a);else if("object"==typeof exports){var b=require("fs");module.exports=a(),module.exports.css=function(){return b.readFileSync(__dirname+"/nouislider.min.css","utf8")}}else window.noUiSlider=a()}(function(){"use strict";function a(a){return a.filter(function(a){return this[a]?!1:this[a]=!0},{})}function b(a,b){return Math.round(a/b)*b}function c(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.defaultView||c.parentWindow,e=c.documentElement,f=d.pageXOffset;return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(f=0),{top:b.top+d.pageYOffset-e.clientTop,left:b.left+f-e.clientLeft}}function d(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)}function e(a){var b=Math.pow(10,7);return Number((Math.round(a*b)/b).toFixed(7))}function f(a,b,c){j(a,b),setTimeout(function(){k(a,b)},c)}function g(a){return Math.max(Math.min(a,100),0)}function h(a){return Array.isArray(a)?a:[a]}function i(a){var b=a.split(".");return b.length>1?b[1].length:0}function j(a,b){a.classList?a.classList.add(b):a.className+=" "+b}function k(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(^|\\b)"+b.split(" ").join("|")+"(\\b|$)","gi")," ")}function l(a,b){a.classList?a.classList.contains(b):new RegExp("(^| )"+b+"( |$)","gi").test(a.className)}function m(a,b){return 100/(b-a)}function n(a,b){return 100*b/(a[1]-a[0])}function o(a,b){return n(a,a[0]<0?b+Math.abs(a[0]):b-a[0])}function p(a,b){return b*(a[1]-a[0])/100+a[0]}function q(a,b){for(var c=1;a>=b[c];)c+=1;return c}function r(a,b,c){if(c>=a.slice(-1)[0])return 100;var d,e,f,g,h=q(c,a);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],f+o([d,e],c)/m(f,g)}function s(a,b,c){if(c>=100)return a.slice(-1)[0];var d,e,f,g,h=q(c,b);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],p([d,e],(c-f)*m(f,g))}function t(a,c,d,e){if(100===e)return e;var f,g,h=q(e,a);return d?(f=a[h-1],g=a[h],e-f>(g-f)/2?g:f):c[h-1]?a[h-1]+b(e-a[h-1],c[h-1]):e}function u(a,b,c){var e;if("number"==typeof b&&(b=[b]),"[object Array]"!==Object.prototype.toString.call(b))throw new Error("noUiSlider: 'range' contains invalid value.");if(e="min"===a?0:"max"===a?100:parseFloat(a),!d(e)||!d(b[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");c.xPct.push(e),c.xVal.push(b[0]),e?c.xSteps.push(isNaN(b[1])?!1:b[1]):isNaN(b[1])||(c.xSteps[0]=b[1])}function v(a,b,c){return b?void(c.xSteps[a]=n([c.xVal[a],c.xVal[a+1]],b)/m(c.xPct[a],c.xPct[a+1])):!0}function w(a,b,c,d){this.xPct=[],this.xVal=[],this.xSteps=[d||!1],this.xNumSteps=[!1],this.snap=b,this.direction=c;var e,f=[];for(e in a)a.hasOwnProperty(e)&&f.push([a[e],e]);for(f.sort(function(a,b){return a[0]-b[0]}),e=0;e<f.length;e++)u(f[e][1],f[e][0],this);for(this.xNumSteps=this.xSteps.slice(0),e=0;e<this.xNumSteps.length;e++)v(e,this.xNumSteps[e],this)}function x(a,b){if(!d(b))throw new Error("noUiSlider: 'step' is not numeric.");a.singleStep=b}function y(a,b){if("object"!=typeof b||Array.isArray(b))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");a.spectrum=new w(b,a.snap,a.dir,a.singleStep)}function z(a,b){if(b=h(b),!Array.isArray(b)||!b.length||b.length>2)throw new Error("noUiSlider: 'start' option is incorrect.");a.handles=b.length,a.start=b}function A(a,b){if(a.snap=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function B(a,b){if(a.animate=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function C(a,b){if("lower"===b&&1===a.handles)a.connect=1;else if("upper"===b&&1===a.handles)a.connect=2;else if(b===!0&&2===a.handles)a.connect=3;else{if(b!==!1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");a.connect=0}}function D(a,b){switch(b){case"horizontal":a.ort=0;break;case"vertical":a.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function E(a,b){if(!d(b))throw new Error("noUiSlider: 'margin' option must be numeric.");if(a.margin=a.spectrum.getMargin(b),!a.margin)throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function F(a,b){if(!d(b))throw new Error("noUiSlider: 'limit' option must be numeric.");if(a.limit=a.spectrum.getMargin(b),!a.limit)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders.")}function G(a,b){switch(b){case"ltr":a.dir=0;break;case"rtl":a.dir=1,a.connect=[0,2,1,3][a.connect];break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function H(a,b){if("string"!=typeof b)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var c=b.indexOf("tap")>=0,d=b.indexOf("drag")>=0,e=b.indexOf("fixed")>=0,f=b.indexOf("snap")>=0;a.events={tap:c||f,drag:d,fixed:e,snap:f}}function I(a,b){if(a.format=b,"function"==typeof b.to&&"function"==typeof b.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function J(a){var b,c={margin:0,limit:0,animate:!0,format:U};b={step:{r:!1,t:x},start:{r:!0,t:z},connect:{r:!0,t:C},direction:{r:!0,t:G},snap:{r:!1,t:A},animate:{r:!1,t:B},range:{r:!0,t:y},orientation:{r:!1,t:D},margin:{r:!1,t:E},limit:{r:!1,t:F},behaviour:{r:!0,t:H},format:{r:!1,t:I}};var d={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"};return Object.keys(d).forEach(function(b){void 0===a[b]&&(a[b]=d[b])}),Object.keys(b).forEach(function(d){var e=b[d];if(void 0===a[d]){if(e.r)throw new Error("noUiSlider: '"+d+"' is required.");return!0}e.t(c,a[d])}),c.pips=a.pips,c.style=c.ort?"top":"left",c}function K(a,b,c){var d=a+b[0],e=a+b[1];return c?(0>d&&(e+=Math.abs(d)),e>100&&(d-=e-100),[g(d),g(e)]):[d,e]}function L(a){a.preventDefault();var b,c,d=0===a.type.indexOf("touch"),e=0===a.type.indexOf("mouse"),f=0===a.type.indexOf("pointer"),g=a;return 0===a.type.indexOf("MSPointer")&&(f=!0),d&&(b=a.changedTouches[0].pageX,c=a.changedTouches[0].pageY),(e||f)&&(b=a.clientX+window.pageXOffset,c=a.clientY+window.pageYOffset),g.points=[b,c],g.cursor=e||f,g}function M(a,b){var c=document.createElement("div"),d=document.createElement("div"),e=["-lower","-upper"];return a&&e.reverse(),j(d,T[3]),j(d,T[3]+e[b]),j(c,T[2]),c.appendChild(d),c}function N(a,b,c){switch(a){case 1:j(b,T[7]),j(c[0],T[6]);break;case 3:j(c[1],T[6]);case 2:j(c[0],T[7]);case 0:j(b,T[6])}}function O(a,b,c){var d,e=[];for(d=0;a>d;d+=1)e.push(c.appendChild(M(b,d)));return e}function P(a,b,c){j(c,T[0]),j(c,T[8+a]),j(c,T[4+b]);var d=document.createElement("div");return j(d,T[1]),c.appendChild(d),d}function Q(b,d){function e(a,b,c){if("range"===a||"steps"===a)return M.xVal;if("count"===a){var d,e=100/(b-1),f=0;for(b=[];(d=f++*e)<=100;)b.push(d);a="positions"}return"positions"===a?b.map(function(a){return M.fromStepping(c?M.getStep(a):a)}):"values"===a?c?b.map(function(a){return M.fromStepping(M.getStep(M.toStepping(a)))}):b:void 0}function m(b,c,d){var e=M.direction,f={},g=M.xVal[0],h=M.xVal[M.xVal.length-1],i=!1,j=!1,k=0;return M.direction=0,d=a(d.slice().sort(function(a,b){return a-b})),d[0]!==g&&(d.unshift(g),i=!0),d[d.length-1]!==h&&(d.push(h),j=!0),d.forEach(function(a,e){var g,h,l,m,n,o,p,q,r,s,t=a,u=d[e+1];if("steps"===c&&(g=M.xNumSteps[e]),g||(g=u-t),t!==!1&&void 0!==u)for(h=t;u>=h;h+=g){for(m=M.toStepping(h),n=m-k,q=n/b,r=Math.round(q),s=n/r,l=1;r>=l;l+=1)o=k+l*s,f[o.toFixed(5)]=["x",0];p=d.indexOf(h)>-1?1:"steps"===c?2:0,!e&&i&&(p=0),h===u&&j||(f[m.toFixed(5)]=[h,p]),k=m}}),M.direction=e,f}function n(a,b,c){function e(a){return["-normal","-large","-sub"][a]}function f(a,b,c){return'class="'+b+" "+b+"-"+h+" "+b+e(c[1])+'" style="'+d.style+": "+a+'%"'}function g(a,d){M.direction&&(a=100-a),d[1]=d[1]&&b?b(d[0],d[1]):d[1],i.innerHTML+="<div "+f(a,"noUi-marker",d)+"></div>",d[1]&&(i.innerHTML+="<div "+f(a,"noUi-value",d)+">"+c.to(d[0])+"</div>")}var h=["horizontal","vertical"][d.ort],i=document.createElement("div");return j(i,"noUi-pips"),j(i,"noUi-pips-"+h),Object.keys(a).forEach(function(b){g(b,a[b])}),i}function o(a){var b=a.mode,c=a.density||1,d=a.filter||!1,f=a.values||!1,g=a.stepped||!1,h=e(b,f,g),i=m(c,b,h),j=a.format||{to:Math.round};return I.appendChild(n(i,d,j))}function p(){return G["offset"+["Width","Height"][d.ort]]}function q(a,b){void 0!==b&&(b=Math.abs(b-d.dir)),Object.keys(R).forEach(function(c){var d=c.split(".")[0];a===d&&R[c].forEach(function(a){a(h(B()),b,r(Array.prototype.slice.call(Q)))})})}function r(a){return 1===a.length?a[0]:d.dir?a.reverse():a}function s(a,b,c,e){var f=function(b){return I.hasAttribute("disabled")?!1:l(I,T[14])?!1:(b=L(b),a===S.start&&void 0!==b.buttons&&b.buttons>1?!1:(b.calcPoint=b.points[d.ort],void c(b,e)))},g=[];return a.split(" ").forEach(function(a){b.addEventListener(a,f,!1),g.push([a,f])}),g}function t(a,b){var c,d,e=b.handles||H,f=!1,g=100*(a.calcPoint-b.start)/p(),h=e[0]===H[0]?0:1;if(c=K(g,b.positions,e.length>1),f=y(e[0],c[h],1===e.length),e.length>1){if(f=y(e[1],c[h?0:1],!1)||f)for(d=0;d<b.handles.length;d++)q("slide",d)}else f&&q("slide",h)}function u(a,b){var c=G.getElementsByClassName(T[15]),d=b.handles[0]===H[0]?0:1;c.length&&k(c[0],T[15]),a.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener));var e=document.documentElement;e.noUiListeners.forEach(function(a){e.removeEventListener(a[0],a[1])}),k(I,T[12]),q("set",d),q("change",d)}function v(a,b){var c=document.documentElement;if(1===b.handles.length&&(j(b.handles[0].children[0],T[15]),b.handles[0].hasAttribute("disabled")))return!1;a.stopPropagation();var d=s(S.move,c,t,{start:a.calcPoint,handles:b.handles,positions:[J[0],J[H.length-1]]}),e=s(S.end,c,u,{handles:b.handles});if(c.noUiListeners=d.concat(e),a.cursor){document.body.style.cursor=getComputedStyle(a.target).cursor,H.length>1&&j(I,T[12]);var f=function(){return!1};document.body.noUiListener=f,document.body.addEventListener("selectstart",f,!1)}}function w(a){var b,e,g=a.calcPoint,h=0;return a.stopPropagation(),H.forEach(function(a){h+=c(a)[d.style]}),b=h/2>g||1===H.length?0:1,g-=c(G)[d.style],e=100*g/p(),d.events.snap||f(I,T[14],300),H[b].hasAttribute("disabled")?!1:(y(H[b],e),q("slide",b),q("set",b),q("change",b),void(d.events.snap&&v(a,{handles:[H[h]]})))}function x(a){var b,c;if(!a.fixed)for(b=0;b<H.length;b+=1)s(S.start,H[b].children[0],v,{handles:[H[b]]});a.tap&&s(S.start,G,w,{handles:H}),a.drag&&(c=[G.getElementsByClassName(T[7])[0]],j(c[0],T[10]),a.fixed&&c.push(H[c[0]===H[0]?1:0].children[0]),c.forEach(function(a){s(S.start,a,v,{handles:H})}))}function y(a,b,c){var e=a!==H[0]?1:0,f=J[0]+d.margin,h=J[1]-d.margin,i=J[0]+d.limit,l=J[1]-d.limit;return H.length>1&&(b=e?Math.max(b,f):Math.min(b,h)),c!==!1&&d.limit&&H.length>1&&(b=e?Math.min(b,i):Math.max(b,l)),b=M.getStep(b),b=g(parseFloat(b.toFixed(7))),b===J[e]?!1:(a.style[d.style]=b+"%",a.previousSibling||(k(a,T[17]),b>50&&j(a,T[17])),J[e]=b,Q[e]=M.fromStepping(b),q("update",e),!0)}function z(a,b){var c,e,f;for(d.limit&&(a+=1),c=0;a>c;c+=1)e=c%2,f=b[e],null!==f&&f!==!1&&("number"==typeof f&&(f=String(f)),f=d.format.from(f),(f===!1||isNaN(f)||y(H[e],M.toStepping(f),c===3-d.dir)===!1)&&q("update",e))}function A(a){var b,c,e=h(a);for(d.dir&&d.handles>1&&e.reverse(),d.animate&&-1!==J[0]&&f(I,T[14],300),b=H.length>1?3:1,1===e.length&&(b=1),z(b,e),c=0;c<H.length;c++)q("set",c)}function B(){var a,b=[];for(a=0;a<d.handles;a+=1)b[a]=d.format.to(Q[a]);return r(b)}function C(){T.forEach(function(a){a&&k(I,a)}),I.innerHTML="",delete I.noUiSlider}function D(){var a=J.map(function(a,b){var c=M.getApplicableStep(a),d=i(String(c[2])),e=Q[b],f=100===a?null:c[2],g=Number((e-c[2]).toFixed(d)),h=0===a?null:g>=c[1]?c[2]:c[0]||!1;return[h,f]});return r(a)}function E(a,b){R[a]=R[a]||[],R[a].push(b),"update"===a.split(".")[0]&&H.forEach(function(a,b){q("update",b)})}function F(a){var b=a.split(".")[0],c=a.substring(b.length);Object.keys(R).forEach(function(a){var d=a.split(".")[0],e=a.substring(d.length);b&&b!==d||c&&c!==e||delete R[a]})}var G,H,I=b,J=[-1,-1],M=d.spectrum,Q=[],R={};if(I.noUiSlider)throw new Error("Slider was already initialized.");return G=P(d.dir,d.ort,I),H=O(d.handles,d.dir,G),N(d.connect,I,H),x(d.events),d.pips&&o(d.pips),{destroy:C,steps:D,on:E,off:F,get:B,set:A}}function R(a,b){if(!a.nodeName)throw new Error("noUiSlider.create requires a single element.");var c=J(b,a),d=Q(a,c);if(d.set(c.start),a.noUiSlider=d,b.tooltips===!0||void 0===b.tooltips){for(var e=a.getElementsByClassName("noUi-handle"),f=[],g=0;g<e.length;g++)f[g]=document.createElement("div"),e[g].appendChild(f[g]),f[g].className+="range-label",f[g].innerHTML="<span></span>",f[g]=f[g].getElementsByTagName("span")[0];a.noUiSlider.on("update",function(a,b){f[b].innerHTML=a[b]})}}var S=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"},T=["noUi-target","noUi-base","noUi-origin","noUi-handle","noUi-horizontal","noUi-vertical","noUi-background","noUi-connect","noUi-ltr","noUi-rtl","noUi-dragable","","noUi-state-drag","","noUi-state-tap","noUi-active","","noUi-stacking"];w.prototype.getMargin=function(a){return 2===this.xPct.length?n(this.xVal,a):!1},w.prototype.toStepping=function(a){return a=r(this.xVal,this.xPct,a),this.direction&&(a=100-a),a},w.prototype.fromStepping=function(a){return this.direction&&(a=100-a),e(s(this.xVal,this.xPct,a))},w.prototype.getStep=function(a){return this.direction&&(a=100-a),a=t(this.xPct,this.xSteps,this.snap,a),this.direction&&(a=100-a),a},w.prototype.getApplicableStep=function(a){var b=q(a,this.xPct),c=100===a?2:1;return[this.xNumSteps[b-2],this.xVal[b-c],this.xNumSteps[b-c]]},w.prototype.convert=function(a){return this.getStep(this.toStepping(a))};var U={to:function(a){return a.toFixed(2)},from:Number};return{create:R}});
1
+ !function(){function a(a){return a.split("").reverse().join("")}function b(a,b,c){if((a[b]||a[c])&&a[b]===a[c])throw Error(b)}function c(b,c,d,e,f,g,h,i,j,k,l,m){h=m;var n,o=l="";return g&&(m=g(m)),!("number"!=typeof m||!isFinite(m))&&(b&&0===parseFloat(m.toFixed(b))&&(m=0),0>m&&(n=!0,m=Math.abs(m)),b&&(g=Math.pow(10,b),m=(Math.round(m*g)/g).toFixed(b)),m=m.toString(),-1!==m.indexOf(".")&&(b=m.split("."),m=b[0],d&&(l=d+b[1])),c&&(m=a(m).match(/.{1,3}/g),m=a(m.join(a(c)))),n&&i&&(o+=i),e&&(o+=e),n&&j&&(o+=j),o=o+m+l,f&&(o+=f),k&&(o=k(o,h)),o)}function d(a,b,c,d,e,f,g,h,i,j,k,l){var m;return a="",k&&(l=k(l)),!(!l||"string"!=typeof l)&&(h&&l.substring(0,h.length)===h&&(l=l.replace(h,""),m=!0),d&&l.substring(0,d.length)===d&&(l=l.replace(d,"")),i&&l.substring(0,i.length)===i&&(l=l.replace(i,""),m=!0),e&&l.slice(-1*e.length)===e&&(l=l.slice(0,-1*e.length)),b&&(l=l.split(b).join("")),c&&(l=l.replace(c,".")),m&&(a+="-"),a=Number((a+l).replace(/[^0-9\.\-.]/g,"")),g&&(a=g(a)),!("number"!=typeof a||!isFinite(a))&&a)}function e(a){var c,d,e,f={};for(c=0;c<h.length;c+=1)d=h[c],e=a[d],void 0===e?f[d]="negative"!==d||f.negativeBefore?"mark"===d&&"."!==f.thousand&&".":"-":"decimals"===d?0<e&&8>e&&(f[d]=e):"encoder"===d||"decoder"===d||"edit"===d||"undo"===d?"function"==typeof e&&(f[d]=e):"string"==typeof e&&(f[d]=e);return b(f,"mark","thousand"),b(f,"prefix","negative"),b(f,"prefix","negativeBefore"),f}function f(a,b,c){var d,e=[];for(d=0;d<h.length;d+=1)e.push(a[h[d]]);return e.push(c),b.apply("",e)}function g(a){return this instanceof g?void("object"==typeof a&&(a=e(a),this.to=function(b){return f(a,c,b)},this.from=function(b){return f(a,d,b)})):new g(a)}var h="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=g}(),function(a){"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?module.exports=a():window.noUiSlider=a()}(function(){"use strict";function a(a,b){var c=document.createElement("div");return j(c,b),a.appendChild(c),c}function b(a){return a.filter(function(a){return!this[a]&&(this[a]=!0)},{})}function c(a,b){return Math.round(a/b)*b}function d(a,b){var c=a.getBoundingClientRect(),d=a.ownerDocument,e=d.documentElement,f=m();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(f.x=0),b?c.top+f.y-e.clientTop:c.left+f.x-e.clientLeft}function e(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)}function f(a,b,c){c>0&&(j(a,b),setTimeout(function(){k(a,b)},c))}function g(a){return Math.max(Math.min(a,100),0)}function h(a){return Array.isArray(a)?a:[a]}function i(a){a=String(a);var b=a.split(".");return b.length>1?b[1].length:0}function j(a,b){a.classList?a.classList.add(b):a.className+=" "+b}function k(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(^|\\b)"+b.split(" ").join("|")+"(\\b|$)","gi")," ")}function l(a,b){return a.classList?a.classList.contains(b):new RegExp("\\b"+b+"\\b").test(a.className)}function m(){var a=void 0!==window.pageXOffset,b="CSS1Compat"===(document.compatMode||""),c=a?window.pageXOffset:b?document.documentElement.scrollLeft:document.body.scrollLeft,d=a?window.pageYOffset:b?document.documentElement.scrollTop:document.body.scrollTop;return{x:c,y:d}}function n(){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 o(a,b){return 100/(b-a)}function p(a,b){return 100*b/(a[1]-a[0])}function q(a,b){return p(a,a[0]<0?b+Math.abs(a[0]):b-a[0])}function r(a,b){return b*(a[1]-a[0])/100+a[0]}function s(a,b){for(var c=1;a>=b[c];)c+=1;return c}function t(a,b,c){if(c>=a.slice(-1)[0])return 100;var d,e,f,g,h=s(c,a);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],f+q([d,e],c)/o(f,g)}function u(a,b,c){if(c>=100)return a.slice(-1)[0];var d,e,f,g,h=s(c,b);return d=a[h-1],e=a[h],f=b[h-1],g=b[h],r([d,e],(c-f)*o(f,g))}function v(a,b,d,e){if(100===e)return e;var f,g,h=s(e,a);return d?(f=a[h-1],g=a[h],e-f>(g-f)/2?g:f):b[h-1]?a[h-1]+c(e-a[h-1],b[h-1]):e}function w(a,b,c){var d;if("number"==typeof b&&(b=[b]),"[object Array]"!==Object.prototype.toString.call(b))throw new Error("noUiSlider: 'range' contains invalid value.");if(d="min"===a?0:"max"===a?100:parseFloat(a),!e(d)||!e(b[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");c.xPct.push(d),c.xVal.push(b[0]),d?c.xSteps.push(!isNaN(b[1])&&b[1]):isNaN(b[1])||(c.xSteps[0]=b[1]),c.xHighestCompleteStep.push(0)}function x(a,b,c){if(!b)return!0;c.xSteps[a]=p([c.xVal[a],c.xVal[a+1]],b)/o(c.xPct[a],c.xPct[a+1]);var d=(c.xVal[a+1]-c.xVal[a])/c.xNumSteps[a],e=Math.ceil(Number(d.toFixed(3))-1),f=c.xVal[a]+c.xNumSteps[a]*e;c.xHighestCompleteStep[a]=f}function y(a,b,c,d){this.xPct=[],this.xVal=[],this.xSteps=[d||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=b,this.direction=c;var e,f=[];for(e in a)a.hasOwnProperty(e)&&f.push([a[e],e]);for(f.length&&"object"==typeof f[0][0]?f.sort(function(a,b){return a[0][0]-b[0][0]}):f.sort(function(a,b){return a[0]-b[0]}),e=0;e<f.length;e++)w(f[e][1],f[e][0],this);for(this.xNumSteps=this.xSteps.slice(0),e=0;e<this.xNumSteps.length;e++)x(e,this.xNumSteps[e],this)}function z(a,b){if(!e(b))throw new Error("noUiSlider: 'step' is not numeric.");a.singleStep=b}function A(a,b){if("object"!=typeof b||Array.isArray(b))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(b.min===b.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");a.spectrum=new y(b,a.snap,a.dir,a.singleStep)}function B(a,b){if(b=h(b),!Array.isArray(b)||!b.length)throw new Error("noUiSlider: 'start' option is incorrect.");a.handles=b.length,a.start=b}function C(a,b){if(a.snap=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function D(a,b){if(a.animate=b,"boolean"!=typeof b)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function E(a,b){if(a.animationDuration=b,"number"!=typeof b)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function F(a,b){var c,d=[!1];if("lower"===b?b=[!0,!1]:"upper"===b&&(b=[!1,!0]),b===!0||b===!1){for(c=1;c<a.handles;c++)d.push(b);d.push(!1)}else{if(!Array.isArray(b)||!b.length||b.length!==a.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");d=b}a.connect=d}function G(a,b){switch(b){case"horizontal":a.ort=0;break;case"vertical":a.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function H(a,b){if(!e(b))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==b&&(a.margin=a.spectrum.getMargin(b),!a.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function I(a,b){if(!e(b))throw new Error("noUiSlider: 'limit' option must be numeric.");if(a.limit=a.spectrum.getMargin(b),!a.limit||a.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function J(a,b){if(!e(b))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==b){if(a.padding=a.spectrum.getMargin(b),!a.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(a.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(a.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function K(a,b){switch(b){case"ltr":a.dir=0;break;case"rtl":a.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function L(a,b){if("string"!=typeof b)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var c=b.indexOf("tap")>=0,d=b.indexOf("drag")>=0,e=b.indexOf("fixed")>=0,f=b.indexOf("snap")>=0,g=b.indexOf("hover")>=0;if(e){if(2!==a.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");H(a,a.start[1]-a.start[0])}a.events={tap:c||f,drag:d,fixed:e,snap:f,hover:g}}function M(a,b){if(b!==!1)if(b===!0){a.tooltips=[];for(var c=0;c<a.handles;c++)a.tooltips.push(!0)}else{if(a.tooltips=h(b),a.tooltips.length!==a.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");a.tooltips.forEach(function(a){if("boolean"!=typeof a&&("object"!=typeof a||"function"!=typeof a.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function N(a,b){if(a.format=b,"function"==typeof b.to&&"function"==typeof b.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function O(a,b){if(void 0!==b&&"string"!=typeof b&&b!==!1)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");a.cssPrefix=b}function P(a,b){if(void 0!==b&&"object"!=typeof b)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof a.cssPrefix){a.cssClasses={};for(var c in b)b.hasOwnProperty(c)&&(a.cssClasses[c]=a.cssPrefix+b[c])}else a.cssClasses=b}function Q(a,b){if(b!==!0&&b!==!1)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");a.useRequestAnimationFrame=b}function R(a){var b={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:U},c={step:{r:!1,t:z},start:{r:!0,t:B},connect:{r:!0,t:F},direction:{r:!0,t:K},snap:{r:!1,t:C},animate:{r:!1,t:D},animationDuration:{r:!1,t:E},range:{r:!0,t:A},orientation:{r:!1,t:G},margin:{r:!1,t:H},limit:{r:!1,t:I},padding:{r:!1,t:J},behaviour:{r:!0,t:L},format:{r:!1,t:N},tooltips:{r:!1,t:M},cssPrefix:{r:!1,t:O},cssClasses:{r:!1,t:P},useRequestAnimationFrame:{r:!1,t:Q}},d={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",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(c).forEach(function(e){if(void 0===a[e]&&void 0===d[e]){if(c[e].r)throw new Error("noUiSlider: '"+e+"' is required.");return!0}c[e].t(b,void 0===a[e]?d[e]:a[e])}),b.pips=a.pips;var e=[["left","top"],["right","bottom"]];return b.style=e[b.dir][b.ort],b.styleOposite=e[b.dir?0:1][b.ort],b}function S(c,e,i){function o(b,c){var d=a(b,e.cssClasses.origin),f=a(d,e.cssClasses.handle);return f.setAttribute("data-handle",c),0===c?j(f,e.cssClasses.handleLower):c===e.handles-1&&j(f,e.cssClasses.handleUpper),d}function p(b,c){return!!c&&a(b,e.cssClasses.connect)}function q(a,b){ba=[],ca=[],ca.push(p(b,a[0]));for(var c=0;c<e.handles;c++)ba.push(o(b,c)),ha[c]=c,ca.push(p(b,a[c+1]))}function r(b){j(b,e.cssClasses.target),0===e.dir?j(b,e.cssClasses.ltr):j(b,e.cssClasses.rtl),0===e.ort?j(b,e.cssClasses.horizontal):j(b,e.cssClasses.vertical),aa=a(b,e.cssClasses.base)}function s(b,c){return!!e.tooltips[c]&&a(b.firstChild,e.cssClasses.tooltip)}function t(){var a=ba.map(s);Z("update",function(b,c,d){if(a[c]){var f=b[c];e.tooltips[c]!==!0&&(f=e.tooltips[c].to(d[c])),a[c].innerHTML="<span>"+f+"</span>"}})}function u(a,b,c){if("range"===a||"steps"===a)return ja.xVal;if("count"===a){var d,e=100/(b-1),f=0;for(b=[];(d=f++*e)<=100;)b.push(d);a="positions"}return"positions"===a?b.map(function(a){return ja.fromStepping(c?ja.getStep(a):a)}):"values"===a?c?b.map(function(a){return ja.fromStepping(ja.getStep(ja.toStepping(a)))}):b:void 0}function v(a,c,d){function e(a,b){return(a+b).toFixed(7)/1}var f={},g=ja.xVal[0],h=ja.xVal[ja.xVal.length-1],i=!1,j=!1,k=0;return d=b(d.slice().sort(function(a,b){return a-b})),d[0]!==g&&(d.unshift(g),i=!0),d[d.length-1]!==h&&(d.push(h),j=!0),d.forEach(function(b,g){var h,l,m,n,o,p,q,r,s,t,u=b,v=d[g+1];if("steps"===c&&(h=ja.xNumSteps[g]),h||(h=v-u),u!==!1&&void 0!==v)for(h=Math.max(h,1e-7),l=u;l<=v;l=e(l,h)){for(n=ja.toStepping(l),o=n-k,r=o/a,s=Math.round(r),t=o/s,m=1;m<=s;m+=1)p=k+m*t,f[p.toFixed(5)]=["x",0];q=d.indexOf(l)>-1?1:"steps"===c?2:0,!g&&i&&(q=0),l===v&&j||(f[n.toFixed(5)]=[l,q]),k=n}}),f}function w(a,b,c){function d(a,b){var c=b===e.cssClasses.value,d=c?m:n,f=c?k:l;return b+" "+d[e.ort]+" "+f[a]}function f(a,b,c){return'class="'+d(c[1],b)+'" style="'+e.style+": "+a+'%"'}function g(a,d){d[1]=d[1]&&b?b(d[0],d[1]):d[1],i+="<div "+f(a,e.cssClasses.marker,d)+"></div>",d[1]&&(i+="<div "+f(a,e.cssClasses.value,d)+">"+c.to(d[0])+"</div>")}var h=document.createElement("div"),i="",k=[e.cssClasses.valueNormal,e.cssClasses.valueLarge,e.cssClasses.valueSub],l=[e.cssClasses.markerNormal,e.cssClasses.markerLarge,e.cssClasses.markerSub],m=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],n=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];return j(h,e.cssClasses.pips),j(h,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(a).forEach(function(b){g(b,a[b])}),h.innerHTML=i,h}function x(a){var b=a.mode,c=a.density||1,d=a.filter||!1,e=a.values||!1,f=a.stepped||!1,g=u(b,e,f),h=v(c,b,g),i=a.format||{to:Math.round};return fa.appendChild(w(h,d,i))}function y(){var a=aa.getBoundingClientRect(),b="offset"+["Width","Height"][e.ort];return 0===e.ort?a.width||aa[b]:a.height||aa[b]}function z(a,b,c,d){var f=function(b){return!fa.hasAttribute("disabled")&&(!l(fa,e.cssClasses.tap)&&(!!(b=A(b,d.pageOffset))&&(!(a===ea.start&&void 0!==b.buttons&&b.buttons>1)&&((!d.hover||!b.buttons)&&(b.calcPoint=b.points[e.ort],void c(b,d))))))},g=[];return a.split(" ").forEach(function(a){b.addEventListener(a,f,!1),g.push([a,f])}),g}function A(a,b){a.preventDefault();var c,d,e=0===a.type.indexOf("touch"),f=0===a.type.indexOf("mouse"),g=0===a.type.indexOf("pointer");if(0===a.type.indexOf("MSPointer")&&(g=!0),e){if(a.touches.length>1)return!1;c=a.changedTouches[0].pageX,d=a.changedTouches[0].pageY}return b=b||m(),(f||g)&&(c=a.clientX+b.x,d=a.clientY+b.y),a.pageOffset=b,a.points=[c,d],a.cursor=f||g,a}function B(a){var b=a-d(aa,e.ort),c=100*b/y();return e.dir?100-c:c}function C(a){var b=100,c=!1;return ba.forEach(function(d,e){if(!d.hasAttribute("disabled")){var f=Math.abs(ga[e]-a);f<b&&(c=e,b=f)}}),c}function D(a,b,c,d){var e=c.slice(),f=[!a,a],g=[a,!a];d=d.slice(),a&&d.reverse(),d.length>1?d.forEach(function(a,c){var d=M(e,a,e[a]+b,f[c],g[c]);d===!1?b=0:(b=d-e[a],e[a]=d)}):f=g=[!0];var h=!1;d.forEach(function(a,d){h=Q(a,c[a]+b,f[d],g[d])||h}),h&&d.forEach(function(a){E("update",a),E("slide",a)})}function E(a,b,c){Object.keys(la).forEach(function(d){var f=d.split(".")[0];a===f&&la[d].forEach(function(a){a.call(da,ka.map(e.format.to),b,ka.slice(),c||!1,ga.slice())})})}function F(a,b){"mouseout"===a.type&&"HTML"===a.target.nodeName&&null===a.relatedTarget&&H(a,b)}function G(a,b){if(navigator.appVersion.indexOf("MSIE 9")===-1&&0===a.buttons&&0!==b.buttonsProperty)return H(a,b);var c=(e.dir?-1:1)*(a.calcPoint-b.startCalcPoint),d=100*c/b.baseSize;D(c>0,d,b.locations,b.handleNumbers)}function H(a,b){ia&&(k(ia,e.cssClasses.active),ia=!1),a.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach(function(a){document.documentElement.removeEventListener(a[0],a[1])}),k(fa,e.cssClasses.drag),P(),b.handleNumbers.forEach(function(a){E("set",a),E("change",a),E("end",a)})}function I(a,b){if(1===b.handleNumbers.length){var c=ba[b.handleNumbers[0]];if(c.hasAttribute("disabled"))return!1;ia=c.children[0],j(ia,e.cssClasses.active)}a.preventDefault(),a.stopPropagation();var d=z(ea.move,document.documentElement,G,{startCalcPoint:a.calcPoint,baseSize:y(),pageOffset:a.pageOffset,handleNumbers:b.handleNumbers,buttonsProperty:a.buttons,locations:ga.slice()}),f=z(ea.end,document.documentElement,H,{handleNumbers:b.handleNumbers}),g=z("mouseout",document.documentElement,F,{handleNumbers:b.handleNumbers});if(document.documentElement.noUiListeners=d.concat(f,g),a.cursor){document.body.style.cursor=getComputedStyle(a.target).cursor,ba.length>1&&j(fa,e.cssClasses.drag);var h=function(){return!1};document.body.noUiListener=h,document.body.addEventListener("selectstart",h,!1)}b.handleNumbers.forEach(function(a){E("start",a)})}function J(a){a.stopPropagation();var b=B(a.calcPoint),c=C(b);return c!==!1&&(e.events.snap||f(fa,e.cssClasses.tap,e.animationDuration),Q(c,b,!0,!0),P(),E("slide",c,!0),E("set",c,!0),E("change",c,!0),E("update",c,!0),void(e.events.snap&&I(a,{handleNumbers:[c]})))}function K(a){var b=B(a.calcPoint),c=ja.getStep(b),d=ja.fromStepping(c);Object.keys(la).forEach(function(a){"hover"===a.split(".")[0]&&la[a].forEach(function(a){a.call(da,d)})})}function L(a){a.fixed||ba.forEach(function(a,b){z(ea.start,a.children[0],I,{handleNumbers:[b]})}),a.tap&&z(ea.start,aa,J,{}),a.hover&&z(ea.move,aa,K,{hover:!0}),a.drag&&ca.forEach(function(b,c){if(b!==!1&&0!==c&&c!==ca.length-1){var d=ba[c-1],f=ba[c],g=[b];j(b,e.cssClasses.draggable),a.fixed&&(g.push(d.children[0]),g.push(f.children[0])),g.forEach(function(a){z(ea.start,a,I,{handles:[d,f],handleNumbers:[c-1,c]})})}})}function M(a,b,c,d,f){return ba.length>1&&(d&&b>0&&(c=Math.max(c,a[b-1]+e.margin)),f&&b<ba.length-1&&(c=Math.min(c,a[b+1]-e.margin))),ba.length>1&&e.limit&&(d&&b>0&&(c=Math.min(c,a[b-1]+e.limit)),f&&b<ba.length-1&&(c=Math.max(c,a[b+1]-e.limit))),e.padding&&(0===b&&(c=Math.max(c,e.padding)),b===ba.length-1&&(c=Math.min(c,100-e.padding))),c=ja.getStep(c),c=g(c),c!==a[b]&&c}function N(a){return a+"%"}function O(a,b){ga[a]=b,ka[a]=ja.fromStepping(b);var c=function(){ba[a].style[e.style]=N(b),S(a),S(a+1)};window.requestAnimationFrame&&e.useRequestAnimationFrame?window.requestAnimationFrame(c):c()}function P(){ha.forEach(function(a){var b=ga[a]>50?-1:1,c=3+(ba.length+b*a);ba[a].childNodes[0].style.zIndex=c})}function Q(a,b,c,d){return b=M(ga,a,b,c,d),b!==!1&&(O(a,b),!0)}function S(a){if(ca[a]){var b=0,c=100;0!==a&&(b=ga[a-1]),a!==ca.length-1&&(c=ga[a]),ca[a].style[e.style]=N(b),ca[a].style[e.styleOposite]=N(100-c)}}function T(a,b){null!==a&&a!==!1&&("number"==typeof a&&(a=String(a)),a=e.format.from(a),a===!1||isNaN(a)||Q(b,ja.toStepping(a),!1,!1))}function U(a,b){var c=h(a),d=void 0===ga[0];b=void 0===b||!!b,c.forEach(T),e.animate&&!d&&f(fa,e.cssClasses.tap,e.animationDuration),ha.forEach(function(a){Q(a,ga[a],!0,!1)}),P(),ha.forEach(function(a){E("update",a),null!==c[a]&&b&&E("set",a)})}function V(a){U(e.start,a)}function W(){var a=ka.map(e.format.to);return 1===a.length?a[0]:a}function X(){for(var a in e.cssClasses)e.cssClasses.hasOwnProperty(a)&&k(fa,e.cssClasses[a]);for(;fa.firstChild;)fa.removeChild(fa.firstChild);delete fa.noUiSlider}function Y(){return ga.map(function(a,b){var c=ja.getNearbySteps(a),d=ka[b],e=c.thisStep.step,f=null;e!==!1&&d+e>c.stepAfter.startValue&&(e=c.stepAfter.startValue-d),f=d>c.thisStep.startValue?c.thisStep.step:c.stepBefore.step!==!1&&d-c.stepBefore.highestStep,100===a?e=null:0===a&&(f=null);var g=ja.countStepDecimals();return null!==e&&e!==!1&&(e=Number(e.toFixed(g))),null!==f&&f!==!1&&(f=Number(f.toFixed(g))),[f,e]})}function Z(a,b){la[a]=la[a]||[],la[a].push(b),"update"===a.split(".")[0]&&ba.forEach(function(a,b){E("update",b)})}function $(a){var b=a&&a.split(".")[0],c=b&&a.substring(b.length);Object.keys(la).forEach(function(a){var d=a.split(".")[0],e=a.substring(d.length);b&&b!==d||c&&c!==e||delete la[a]})}function _(a,b){var c=W(),d=["margin","limit","padding","range","animate","snap","step","format"];d.forEach(function(b){void 0!==a[b]&&(i[b]=a[b])});var f=R(i);d.forEach(function(b){void 0!==a[b]&&(e[b]=f[b])}),f.spectrum.direction=ja.direction,ja=f.spectrum,e.margin=f.margin,e.limit=f.limit,e.padding=f.padding,ga=[],U(a.start||c,b)}var aa,ba,ca,da,ea=n(),fa=c,ga=[],ha=[],ia=!1,ja=e.spectrum,ka=[],la={};if(fa.noUiSlider)throw new Error("Slider was already initialized.");return r(fa),q(e.connect,aa),da={destroy:X,steps:Y,on:Z,off:$,get:W,set:U,reset:V,__moveHandles:function(a,b,c){D(a,b,ga,c)},options:i,updateOptions:_,target:fa,pips:x},L(e.events),U(e.start),e.pips&&x(e.pips),e.tooltips&&t(),da}function T(a,b){if(!a.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===b.tooltips&&(b.tooltips=!0);var c=R(b,a),d=S(a,c,b);return a.noUiSlider=d,d}y.prototype.getMargin=function(a){var b=this.xNumSteps[0];if(b&&a/b%1!==0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&p(this.xVal,a)},y.prototype.toStepping=function(a){return a=t(this.xVal,this.xPct,a)},y.prototype.fromStepping=function(a){return u(this.xVal,this.xPct,a)},y.prototype.getStep=function(a){return a=v(this.xPct,this.xSteps,this.snap,a)},y.prototype.getNearbySteps=function(a){var b=s(a,this.xPct);return{stepBefore:{startValue:this.xVal[b-2],step:this.xNumSteps[b-2],highestStep:this.xHighestCompleteStep[b-2]},thisStep:{startValue:this.xVal[b-1],step:this.xNumSteps[b-1],highestStep:this.xHighestCompleteStep[b-1]},stepAfter:{startValue:this.xVal[b-0],step:this.xNumSteps[b-0],highestStep:this.xHighestCompleteStep[b-0]}}},y.prototype.countStepDecimals=function(){var a=this.xNumSteps.map(i);return Math.max.apply(null,a)},y.prototype.convert=function(a){return this.getStep(this.toStepping(a))};var U={to:function(a){return void 0!==a&&a.toFixed(2)},from:Number};return{create:T}});
@@ -5,11 +5,13 @@
5
5
  Materialize.updateTextFields = function() {
6
6
  var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
7
7
  $(input_selector).each(function(index, element) {
8
- if ($(element).val().length > 0 || element.autofocus ||$(this).attr('placeholder') !== undefined || $(element)[0].validity.badInput === true) {
9
- $(this).siblings('label').addClass('active');
10
- }
11
- else {
12
- $(this).siblings('label').removeClass('active');
8
+ var $this = $(this);
9
+ if ($(element).val().length > 0 || element.autofocus || $this.attr('placeholder') !== undefined) {
10
+ $this.siblings('label').addClass('active');
11
+ } else if ($(element)[0].validity) {
12
+ $this.siblings('label').toggleClass('active', $(element)[0].validity.badInput === true);
13
+ } else {
14
+ $this.siblings('label').removeClass('active');
13
15
  }
14
16
  });
15
17
  };
@@ -68,8 +70,8 @@
68
70
  });
69
71
 
70
72
  window.validate_field = function(object) {
71
- var hasLength = object.attr('length') !== undefined;
72
- var lenAttr = parseInt(object.attr('length'));
73
+ var hasLength = object.attr('data-length') !== undefined;
74
+ var lenAttr = parseInt(object.attr('data-length'));
73
75
  var len = object.val().length;
74
76
 
75
77
  if (object.val().length === 0 && object[0].validity.badInput === false) {
@@ -281,7 +283,9 @@
281
283
  $.fn.autocomplete = function (options) {
282
284
  // Defaults
283
285
  var defaults = {
284
- data: {}
286
+ data: {},
287
+ limit: Infinity,
288
+ onAutocomplete: null
285
289
  };
286
290
 
287
291
  options = $.extend(defaults, options);
@@ -289,20 +293,34 @@
289
293
  return this.each(function() {
290
294
  var $input = $(this);
291
295
  var data = options.data,
296
+ count = 0,
297
+ activeIndex = 0,
298
+ oldVal,
292
299
  $inputDiv = $input.closest('.input-field'); // Div to append on
293
300
 
294
301
  // Check if data isn't empty
295
302
  if (!$.isEmptyObject(data)) {
296
- // Create autocomplete element
297
303
  var $autocomplete = $('<ul class="autocomplete-content dropdown-content"></ul>');
304
+ var $oldAutocomplete;
298
305
 
299
- // Append autocomplete element
306
+ // Append autocomplete element.
307
+ // Prevent double structure init.
300
308
  if ($inputDiv.length) {
301
- $inputDiv.append($autocomplete); // Set ul in body
309
+ $oldAutocomplete = $inputDiv.children('.autocomplete-content.dropdown-content').first();
310
+ if (!$oldAutocomplete.length) {
311
+ $inputDiv.append($autocomplete); // Set ul in body
312
+ }
302
313
  } else {
303
- $input.after($autocomplete);
314
+ $oldAutocomplete = $input.next('.autocomplete-content.dropdown-content');
315
+ if (!$oldAutocomplete.length) {
316
+ $input.after($autocomplete);
317
+ }
318
+ }
319
+ if ($oldAutocomplete.length) {
320
+ $autocomplete = $oldAutocomplete;
304
321
  }
305
322
 
323
+ // Highlight partial match.
306
324
  var highlight = function(string, $el) {
307
325
  var img = $el.find('img');
308
326
  var matchStart = $el.text().toLowerCase().indexOf("" + string.toLowerCase() + ""),
@@ -316,42 +334,109 @@
316
334
  }
317
335
  };
318
336
 
337
+ // Reset current element position
338
+ var resetCurrentElement = function() {
339
+ activeIndex = 0;
340
+ $autocomplete.find('.active').removeClass('active');
341
+ }
342
+
319
343
  // Perform search
320
- $input.on('keyup', function (e) {
321
- // Capture Enter
322
- if (e.which === 13) {
323
- $autocomplete.find('li').first().click();
344
+ $input.off('keyup.autocomplete').on('keyup.autocomplete', function (e) {
345
+ // Reset count.
346
+ count = 0;
347
+
348
+ // Don't capture enter or arrow key usage.
349
+ if (e.which === 13 ||
350
+ e.which === 38 ||
351
+ e.which === 40) {
324
352
  return;
325
353
  }
326
354
 
327
355
  var val = $input.val().toLowerCase();
328
- $autocomplete.empty();
329
356
 
330
357
  // Check if the input isn't empty
331
- if (val !== '') {
332
- for(var key in data) {
333
- if (data.hasOwnProperty(key) &&
334
- key.toLowerCase().indexOf(val) !== -1 &&
335
- key.toLowerCase() !== val) {
336
- var autocompleteOption = $('<li></li>');
337
- if(!!data[key]) {
338
- autocompleteOption.append('<img src="'+ data[key] +'" class="right circle"><span>'+ key +'</span>');
339
- } else {
340
- autocompleteOption.append('<span>'+ key +'</span>');
358
+ if (oldVal !== val) {
359
+ $autocomplete.empty();
360
+ resetCurrentElement();
361
+
362
+ if (val !== '') {
363
+ for(var key in data) {
364
+ if (data.hasOwnProperty(key) &&
365
+ key.toLowerCase().indexOf(val) !== -1 &&
366
+ key.toLowerCase() !== val) {
367
+ // Break if past limit
368
+ if (count >= options.limit) {
369
+ break;
370
+ }
371
+
372
+ var autocompleteOption = $('<li></li>');
373
+ if (!!data[key]) {
374
+ autocompleteOption.append('<img src="'+ data[key] +'" class="right circle"><span>'+ key +'</span>');
375
+ } else {
376
+ autocompleteOption.append('<span>'+ key +'</span>');
377
+ }
378
+
379
+ $autocomplete.append(autocompleteOption);
380
+ highlight(val, autocompleteOption);
381
+ count++;
341
382
  }
342
- $autocomplete.append(autocompleteOption);
343
-
344
- highlight(val, autocompleteOption);
345
383
  }
346
384
  }
347
385
  }
386
+
387
+ // Update oldVal
388
+ oldVal = val;
389
+ });
390
+
391
+ $input.off('keydown.autocomplete').on('keydown.autocomplete', function (e) {
392
+ // Arrow keys and enter key usage
393
+ var keyCode = e.which,
394
+ liElement,
395
+ numItems = $autocomplete.children('li').length,
396
+ $active = $autocomplete.children('.active').first();
397
+
398
+ // select element on Enter
399
+ if (keyCode === 13) {
400
+ liElement = $autocomplete.children('li').eq(activeIndex);
401
+ if (liElement.length) {
402
+ liElement.click();
403
+ e.preventDefault();
404
+ }
405
+ return;
406
+ }
407
+
408
+ // Capture up and down key
409
+ if ( keyCode === 38 || keyCode === 40 ) {
410
+ e.preventDefault();
411
+
412
+ if (keyCode === 38 &&
413
+ activeIndex > 0) {
414
+ activeIndex--;
415
+ }
416
+
417
+ if (keyCode === 40 &&
418
+ activeIndex < (numItems - 1) &&
419
+ $active.length) {
420
+ activeIndex++;
421
+ }
422
+
423
+ $active.removeClass('active');
424
+ $autocomplete.children('li').eq(activeIndex).addClass('active');
425
+ }
348
426
  });
349
427
 
350
428
  // Set input value
351
429
  $autocomplete.on('click', 'li', function () {
352
- $input.val($(this).text().trim());
430
+ var text = $(this).text().trim();
431
+ $input.val(text);
353
432
  $input.trigger('change');
354
433
  $autocomplete.empty();
434
+ resetCurrentElement();
435
+
436
+ // Handle onAutocomplete callback.
437
+ if (typeof(options.onAutocomplete) === "function") {
438
+ options.onAutocomplete.call(this, text);
439
+ }
355
440
  });
356
441
  }
357
442
  });
@@ -514,10 +599,14 @@
514
599
  if (!options.is(':visible')) {
515
600
  $(this).trigger('open', ['focus']);
516
601
  var label = $(this).val();
602
+ if (multiple && label.indexOf(',') >= 0) {
603
+ label = label.split(',')[0];
604
+ }
605
+
517
606
  var selectedOption = options.find('li').filter(function() {
518
607
  return $(this).text().toLowerCase() === label.toLowerCase();
519
608
  })[0];
520
- activateOption(options, selectedOption);
609
+ activateOption(options, selectedOption, true);
521
610
  }
522
611
  },
523
612
  'click': function (e){
@@ -554,13 +643,20 @@
554
643
  });
555
644
  }
556
645
 
557
- // Make option as selected and scroll to selected position
558
- var activateOption = function(collection, newOption) {
646
+ /**
647
+ * Make option as selected and scroll to selected position
648
+ * @param {jQuery} collection Select options jQuery element
649
+ * @param {Element} newOption element of the new option
650
+ * @param {Boolean} firstActivation If on first activation of select
651
+ */
652
+ var activateOption = function(collection, newOption, firstActivation) {
559
653
  if (newOption) {
560
654
  collection.find('li.selected').removeClass('selected');
561
655
  var option = $(newOption);
562
656
  option.addClass('selected');
563
- options.scrollTo(option);
657
+ if (!multiple || !!firstActivation) {
658
+ options.scrollTo(option);
659
+ }
564
660
  }
565
661
  };
566
662
 
@@ -86,6 +86,61 @@ Materialize.elementOrParentIsFixed = function(element) {
86
86
  return isFixed;
87
87
  };
88
88
 
89
+
90
+ /**
91
+ * Get time in ms
92
+ * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
93
+ * @type {function}
94
+ * @return {number}
95
+ */
96
+ var getTime = (Date.now || function () {
97
+ return new Date().getTime();
98
+ });
99
+
100
+
101
+ /**
102
+ * Returns a function, that, when invoked, will only be triggered at most once
103
+ * during a given window of time. Normally, the throttled function will run
104
+ * as much as it can, without ever going more than once per `wait` duration;
105
+ * but if you'd like to disable the execution on the leading edge, pass
106
+ * `{leading: false}`. To disable execution on the trailing edge, ditto.
107
+ * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
108
+ * @param {function} func
109
+ * @param {number} wait
110
+ * @param {Object=} options
111
+ * @returns {Function}
112
+ */
113
+ Materialize.throttle = function(func, wait, options) {
114
+ var context, args, result;
115
+ var timeout = null;
116
+ var previous = 0;
117
+ options || (options = {});
118
+ var later = function () {
119
+ previous = options.leading === false ? 0 : getTime();
120
+ timeout = null;
121
+ result = func.apply(context, args);
122
+ context = args = null;
123
+ };
124
+ return function () {
125
+ var now = getTime();
126
+ if (!previous && options.leading === false) previous = now;
127
+ var remaining = wait - (now - previous);
128
+ context = this;
129
+ args = arguments;
130
+ if (remaining <= 0) {
131
+ clearTimeout(timeout);
132
+ timeout = null;
133
+ previous = now;
134
+ result = func.apply(context, args);
135
+ context = args = null;
136
+ } else if (!timeout && options.trailing !== false) {
137
+ timeout = setTimeout(later, remaining);
138
+ }
139
+ return result;
140
+ };
141
+ };
142
+
143
+
89
144
  // Velocity has conflicts when loaded with jQuery, this will check for it
90
145
  // First, check if in noConflict mode
91
146
  var Vel;
@@ -78,6 +78,12 @@
78
78
  checkForChanges();
79
79
 
80
80
 
81
+ // BuySellAds Demos close button.
82
+ $('.buysellads.buysellads-demo .close').on('click', function() {
83
+ $(this).parent().remove();
84
+ });
85
+
86
+
81
87
  // Github Latest Commit
82
88
  if ($('.github-commit').length) { // Checks if widget div exists (Index only)
83
89
  $.ajax({
@@ -137,10 +143,35 @@
137
143
  indeterminateCheckbox.indeterminate = true;
138
144
 
139
145
 
146
+ // Pushpin Demo Init
147
+ if ($('.pushpin-demo-nav').length) {
148
+ $('.pushpin-demo-nav').each(function() {
149
+ var $this = $(this);
150
+ var $target = $('#' + $(this).attr('data-target'));
151
+ $this.pushpin({
152
+ top: $target.offset().top,
153
+ bottom: $target.offset().top + $target.outerHeight() - $this.height()
154
+ });
155
+ });
156
+ }
157
+
158
+ // CSS Transitions Demo Init
159
+ if ($('#scale-demo').length &&
160
+ $('#scale-demo-trigger').length) {
161
+ $('#scale-demo-trigger').click(function() {
162
+ $('#scale-demo').toggleClass('scale-out');
163
+ });
164
+ }
165
+
166
+ // Swipeable Tabs Demo Init
167
+ if ($('#tabs-swipe-demo').length) {
168
+ $('#tabs-swipe-demo').tabs({ 'swipeable': true });
169
+ }
170
+
140
171
  // Plugin initialization
141
- $('.carousel.carousel-slider').carousel({full_width: true});
172
+ $('.carousel.carousel-slider').carousel({fullWidth: true});
142
173
  $('.carousel').carousel();
143
- $('.slider').slider({full_width: true});
174
+ $('.slider').slider();
144
175
  $('.parallax').parallax();
145
176
  $('.modal').modal();
146
177
  $('.scrollspy').scrollSpy();
@@ -151,8 +182,8 @@
151
182
  data: {"Apple": null, "Microsoft": null, "Google": 'http://placehold.it/250x250'}
152
183
  });
153
184
 
185
+ // Chips
154
186
  $('.chips').material_chip();
155
-
156
187
  $('.chips-initial').material_chip({
157
188
  readOnly: true,
158
189
  data: [{
@@ -163,11 +194,17 @@
163
194
  tag: 'Google',
164
195
  }]
165
196
  });
166
-
167
197
  $('.chips-placeholder').material_chip({
168
198
  placeholder: 'Enter a tag',
169
199
  secondaryPlaceholder: '+Tag',
170
200
  });
201
+ $('.chips-autocomplete').material_chip({
202
+ autocompleteData: {
203
+ 'Apple': null,
204
+ 'Microsoft': null,
205
+ 'Google': null
206
+ }
207
+ });
171
208
 
172
209
 
173
210
  }); // end of document ready
File without changes
@@ -20,6 +20,7 @@
20
20
  var originalHeight = 0;
21
21
  var ancestorsChanged;
22
22
  var ancestor;
23
+ var originInlineStyles = origin.attr('style');
23
24
  origin.wrap(placeholder);
24
25
 
25
26
 
@@ -75,7 +76,11 @@
75
76
  }
76
77
 
77
78
  // Set css on origin
78
- origin.css({position: 'absolute', 'z-index': 1000})
79
+ origin.css({
80
+ position: 'absolute',
81
+ 'z-index': 1000,
82
+ 'will-change': 'left, top, width, height'
83
+ })
79
84
  .data('width', originalWidth)
80
85
  .data('height', originalHeight);
81
86
 
@@ -88,10 +93,21 @@
88
93
  if (doneAnimating === true)
89
94
  returnToOriginal();
90
95
  });
91
- // Animate Overlay
92
- // Put before in origin image to preserve z-index layering.
93
- origin.before(overlay);
94
- overlay.velocity({opacity: 1},
96
+
97
+ // Put before in origin image to preserve z-index layering.
98
+ origin.before(overlay);
99
+
100
+ // Set dimensions if needed
101
+ var overlayOffset = overlay[0].getBoundingClientRect();
102
+ overlay.css({
103
+ width: windowWidth,
104
+ height: windowHeight,
105
+ left: -1 * overlayOffset.left,
106
+ top: -1 * overlayOffset.top
107
+ })
108
+
109
+ // Animate Overlay
110
+ overlay.velocity({opacity: 1},
95
111
  {duration: inDuration, queue: false, easing: 'easeOutQuad'} );
96
112
 
97
113
  // Add and animate caption if it exists
@@ -162,7 +178,7 @@
162
178
  ); // End Velocity
163
179
  }
164
180
 
165
- }); // End origin on click
181
+ }); // End origin on click
166
182
 
167
183
 
168
184
  // Return on scroll
@@ -186,84 +202,77 @@
186
202
  // This function returns the modaled image to the original spot
187
203
  function returnToOriginal() {
188
204
 
189
- doneAnimating = false;
190
-
191
- var placeholder = origin.parent('.material-placeholder');
192
- var windowWidth = window.innerWidth;
193
- var windowHeight = window.innerHeight;
194
- var originalWidth = origin.data('width');
195
- var originalHeight = origin.data('height');
205
+ doneAnimating = false;
196
206
 
197
- origin.velocity("stop", true);
198
- $('#materialbox-overlay').velocity("stop", true);
199
- $('.materialbox-caption').velocity("stop", true);
207
+ var placeholder = origin.parent('.material-placeholder');
208
+ var windowWidth = window.innerWidth;
209
+ var windowHeight = window.innerHeight;
210
+ var originalWidth = origin.data('width');
211
+ var originalHeight = origin.data('height');
200
212
 
213
+ origin.velocity("stop", true);
214
+ $('#materialbox-overlay').velocity("stop", true);
215
+ $('.materialbox-caption').velocity("stop", true);
201
216
 
202
- $('#materialbox-overlay').velocity({opacity: 0}, {
203
- duration: outDuration, // Delay prevents animation overlapping
204
- queue: false, easing: 'easeOutQuad',
205
- complete: function(){
206
- // Remove Overlay
207
- overlayActive = false;
208
- $(this).remove();
209
- }
210
- });
211
217
 
212
- // Resize Image
213
- origin.velocity(
214
- {
215
- width: originalWidth,
216
- height: originalHeight,
217
- left: 0,
218
- top: 0
219
- },
220
- {
221
- duration: outDuration,
222
- queue: false, easing: 'easeOutQuad'
223
- }
224
- );
218
+ $('#materialbox-overlay').velocity({opacity: 0}, {
219
+ duration: outDuration, // Delay prevents animation overlapping
220
+ queue: false, easing: 'easeOutQuad',
221
+ complete: function(){
222
+ // Remove Overlay
223
+ overlayActive = false;
224
+ $(this).remove();
225
+ }
226
+ });
225
227
 
226
- // Remove Caption + reset css settings on image
227
- $('.materialbox-caption').velocity({opacity: 0}, {
228
- duration: outDuration, // Delay prevents animation overlapping
229
- queue: false, easing: 'easeOutQuad',
230
- complete: function(){
231
- placeholder.css({
232
- height: '',
233
- width: '',
234
- position: '',
235
- top: '',
236
- left: ''
237
- });
238
-
239
- origin.css({
240
- height: '',
241
- top: '',
242
- left: '',
243
- width: '',
244
- 'max-width': '',
245
- position: '',
246
- 'z-index': ''
247
- });
248
-
249
- // Remove class
250
- origin.removeClass('active');
251
- doneAnimating = true;
252
- $(this).remove();
253
-
254
- // Remove overflow overrides on ancestors
255
- if (ancestorsChanged) {
256
- ancestorsChanged.css('overflow', '');
257
- }
228
+ // Resize Image
229
+ origin.velocity(
230
+ {
231
+ width: originalWidth,
232
+ height: originalHeight,
233
+ left: 0,
234
+ top: 0
235
+ },
236
+ {
237
+ duration: outDuration,
238
+ queue: false, easing: 'easeOutQuad'
239
+ }
240
+ );
241
+
242
+ // Remove Caption + reset css settings on image
243
+ $('.materialbox-caption').velocity({opacity: 0}, {
244
+ duration: outDuration, // Delay prevents animation overlapping
245
+ queue: false, easing: 'easeOutQuad',
246
+ complete: function(){
247
+ placeholder.css({
248
+ height: '',
249
+ width: '',
250
+ position: '',
251
+ top: '',
252
+ left: ''
253
+ });
254
+
255
+ origin.removeAttr('style');
256
+ origin.attr('style', originInlineStyles);
257
+
258
+ // Remove class
259
+ origin.removeClass('active');
260
+ doneAnimating = true;
261
+ $(this).remove();
262
+
263
+ // Remove overflow overrides on ancestors
264
+ if (ancestorsChanged) {
265
+ ancestorsChanged.css('overflow', '');
258
266
  }
259
- });
260
-
261
- }
267
+ }
262
268
  });
263
- };
264
269
 
265
- $(document).on('turbolinks:load', function(){
266
- $('.materialboxed').materialbox();
267
- });
270
+ }
271
+ });
272
+ };
273
+
274
+ $(document).on('turbolinks:load', function(){
275
+ $('.materialboxed').materialbox();
276
+ });
268
277
 
269
278
  }( jQuery ));