6 lines
No EOL
1.7 KiB
JavaScript
6 lines
No EOL
1.7 KiB
JavaScript
/*!
|
|
* Bootstrap without jQuery v0.3.1
|
|
* By Daniel Davis under MIT License
|
|
* https://github.com/tagawa/bootstrap-without-jquery
|
|
*/
|
|
;(function(){"use strict";function o(n){for(var f=n.children,r=0,i,t=0,u=f.length;t<u;t++)i=f[t],r+=Math.max(i.clientHeight,i.offsetHeight,i.scrollHeight);return r}function e(n){n=n||window.event;var f=n.currentTarget||n.srcElement,r=f.getAttribute("data-target"),t=document.querySelector(r),u=o(t),i=" "+t.className+" ";return i.indexOf(" in ")>-1?(i=i.replace(" in "," "),t.className=i,t.style.height="0"):(t.className+=" in ",t.style.height=u+"px"),!1}function c(n){n=n||window.event;var r=n.currentTarget||n.srcElement,i=r.parentElement,t=" "+i.className+" ";return t.indexOf(" open ")>-1?(t=t.replace(" open "," "),i.className=t):i.className+=" open ",!1}function h(n){n=n||window.event;var i=n.currentTarget||n.srcElement,t=i.parentElement;return t.className=(" "+t.className+" ").replace(" open "," "),!1}function s(n){n=n||window.event;var i=n.currentTarget||n.srcElement,t=i.parentElement;return t.parentElement.removeChild(t),!1}var f,u,i,r,n,t;for(document.querySelectorAll||(document.querySelectorAll=function(n){var f=document.styleSheets[0]||document.createStyleSheet(),r,i,t,u;for(f.addRule(n,"foo:bar"),r=document.all,i=[],t=0,u=r.length;t<u;t++)r[t].currentStyle.foo==="bar"&&(i[i.length]=r[t]);return f.removeRule(0),i}),f=document.querySelectorAll("[data-toggle=collapse]"),n=0,t=f.length;n<t;n++)f[n].onclick=e;for(u=document.querySelectorAll("[data-toggle=dropdown]"),n=0,t=u.length;n<t;n++)i=u[n],i.setAttribute("tabindex","0"),i.onclick=c,i.onblur=h;for(r=document.querySelectorAll("[data-dismiss=alert]"),n=0,t=r.length;n<t;n++)r[n].onclick=s})(); |