View file upload/js/themehouse/uix_classic_dark/ripple.min.js

File size: 1.39Kb
$(document).ready(function(){for(var l=function(a){if(-1===this.className.indexOf("disabled")){var b=this.querySelector(".ripple-container");b||(b=document.createElement("div"),b.className="ripple-container",this.appendChild(b));var e=b.getBoundingClientRect(),d=e.width,c=document.createElement("div");c.className="ripple";c.style.width=d+"px";c.style.height=d+"px";c.style.top=a.clientY-e.top-d/2+"px";c.style.left=a.clientX-e.left-d/2+"px";b.appendChild(c);setTimeout(function(){b.removeChild(b.children[0])},
1E3)}},k=document.querySelectorAll(".button, .u-ripple, .blockLink, .tabs-tab"),h=0;h<k.length;h++){var a=k[h];if("undefined"!==typeof a.className&&-1===a.className.indexOf("JsOnly")&&-1===a.className.indexOf("DisableOnSubmit")){if("INPUT"===a.tagName){for(var f=document.createElement("button"),g=0,m=a.attributes.length;g<m;++g){var n=a.attributes.item(g).nodeName,p=a.attributes.item(g).nodeValue;f.setAttribute(n,p)}f.innerHTML=a.innerHTML+a.value;a.parentNode&&(a.parentNode.replaceChild(f,a),a=f)}a.className+=
" rippleButton";a.addEventListener("mousedown",l);a.addEventListener("click",function(f){var b=a.href;if(b&&-1===a.className.indexOf("OverlayTrigger")){var e=(new Date).getTime(),d=function(c){c.preventDefault();c=(new Date).getTime()-e;400>c?setTimeout(function(){window.location.href=b},400-c):window.location.href=b;a.removeEventListener("click",d)};a.addEventListener("click",d)}})}}});