bootstrap.native
Advanced tools
Comparing version 2.0.18 to 2.0.19
@@ -1,2 +0,2 @@ | ||
// Native Javascript for Bootstrap 4 v2.0.18 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){"use strict";var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document,i="body",o="data-toggle",l="data-dismiss",a="data-spy",r="data-ride",c="Alert",s="Button",u="Carousel",f="Collapse",d="Dropdown",h="Modal",p="Popover",v="ScrollSpy",m="Tab",g="Tooltip",b="data-backdrop",w="data-keyboard",T="data-target",y="data-interval",x="data-height",C="data-pause",A="data-title",E="data-original-title",L="data-dismissible",I="data-trigger",k="data-animation",M="data-container",S="data-placement",D="data-delay",H="backdrop",N="keyboard",B="delay",P="content",$="target",W="interval",j="pause",O="animation",q="placement",R="container",z="offsetTop",U="offsetLeft",X="scrollTop",Y="scrollLeft",F="clientWidth",G="clientHeight",J="offsetWidth",K="offsetHeight",Q="innerWidth",V="innerHeight",Z="scrollHeight",_="height",tt="aria-expanded",et="aria-hidden",nt="click",it="hover",ot="keydown",lt="resize",at="scroll",rt="show",ct="shown",st="hide",ut="hidden",ft="close",dt="closed",ht="slid",pt="slide",vt="change",mt="getAttribute",gt="setAttribute",bt="hasAttribute",wt="getElementsByTagName",Tt="getBoundingClientRect",yt="querySelectorAll",xt="getElementsByClassName",Ct="indexOf",At="parentNode",Et="preventDefault",Lt="length",It="toLowerCase",kt="Transition",Mt="Webkit",St="style",Dt="active",Ht="show",Nt="collapsing",Bt="left",Pt="right",$t="top",Wt="bottom",jt="fixed-top",Ot="fixed-bottom",qt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Rt=/\b(top|bottom|left|top)+/,zt=0,Ut=Mt+kt in e[St]||kt[It]()in e[St],Xt=Mt+kt in e[St]?Mt[It]()+kt+"End":kt[It]()+"end",Yt=function(t){t.focus?t.focus():t.setActive()},Ft=function(t,e){t.classList.add(e)},Gt=function(t,e){t.classList.remove(e)},Jt=function(t,e){return t.classList.contains(e)},Kt=function(t,e){return[].slice.call(t[xt](e))},Qt=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},Vt=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[At])if("."===n){if(null!==Qt(e,t[At])&&Jt(t,e.replace(".","")))return t}else if("#"===n&&t.id===e.substr(1))return t;return!1},Zt=function(t,e,n){t.addEventListener(e,n,!1)},_t=function(t,e,n){t.removeEventListener(e,n,!1)},te=function(t,e,n){Zt(t,e,function i(o){n(o),_t(t,e,i)})},ee=function(t,e){Ut?te(t,Xt,function(t){e(t)}):e()},ne=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},ie=function(t,e,n){for(var i=0;i<n[Lt];i++)new e(n[i])},oe=/^\#(.)+$/,le=function(n){var i=n[Tt]();return i[$t]>=0&&i[Bt]>=0&&i[Wt]<=(t[V]||e[G])&&i[Pt]<=(t[Q]||e[F])},ae=function(){return{y:t.pageYOffset||e[X],x:t.pageXOffset||e[Y]}},re=function(t,e,o,l){var a=t[Tt](),r=Qt(".arrow",e),c=r[J],s=Jt(e,"popover"),u=l===n[i]?ae():{x:l[U]+l[Y],y:l[z]+l[X]},f={w:a[Pt]-a[Bt],h:a[Wt]-a[$t]},d={w:e[J],h:e[K]};o===$t?(e[St][$t]=a[$t]+u.y-d.h-(s?c:0)+"px",e[St][Bt]=a[Bt]+u.x-d.w/2+f.w/2+"px",r[St][Bt]=d.w/2-c/2+"px"):o===Wt?(e[St][$t]=a[$t]+u.y+f.h+"px",e[St][Bt]=a[Bt]+u.x-d.w/2+f.w/2+"px",r[St][Bt]=d.w/2-c/2+"px"):o===Bt?(e[St][$t]=a[$t]+u.y-d.h/2+f.h/2+"px",e[St][Bt]=a[Bt]+u.x-d.w-(s?c:0)+"px",r[St][$t]=d.h/2-c/2+"px"):o===Pt&&(e[St][$t]=a[$t]+u.y-d.h/2+f.h/2+"px",e[St][Bt]=a[Bt]+u.x+f.w+"px",r[St][$t]=d.h/2-c/2+"px"),e.className[Ct](o)===-1&&(e.className=e.className.replace(Rt,o))},ce=function(t){return t===$t?Wt:t===Wt?$t:t===Bt?Pt:t===Pt?Bt:t},se=function(t){t=Qt(t);var e=this,n="alert",i=Vt(t,"."+n),o=function(){Jt(i,"fade")?ee(i,r):r()},a=function(o){i=Vt(o[$],"."+n),t=Qt("["+l+'="'+n+'"]',i),t&&i&&(t===o[$]||t.contains(o[$]))&&e.close()},r=function(){ne.call(i,dt,n),_t(t,nt,a),i[At].removeChild(i)};this.close=function(){i&&t&&Jt(i,Ht)&&(ne.call(i,ft,n),Gt(i,Ht),i&&o())},c in t||Zt(t,nt,a),t[c]=this};ie(c,se,n[yt]("["+l+'="alert"]'));var ue=function(t){t=Qt(t);var e=!1,n="button",i="checked",o="LABEL",l="INPUT",a=function(a){var r=a[$].tagName===o?a[$]:a[$][At].tagName===o?a[$][At]:null;if(r){var c=this,s=Kt(c,"btn"),u=r[wt](l)[0];if(u){if("checkbox"===u.type&&(u[i]?(Gt(r,Dt),u[mt](i),u.removeAttribute(i),u[i]=!1):(Ft(r,Dt),u[mt](i),u[gt](i,i),u[i]=!0),e||(e=!0,ne.call(u,vt,n),ne.call(t,vt,n))),"radio"===u.type&&!e&&!u[i]){Ft(r,Dt),u[gt](i,i),u[i]=!0,ne.call(u,vt,n),ne.call(t,vt,n),e=!0;for(var f=0,d=s[Lt];f<d;f++){var h=s[f],p=h[wt](l)[0];h!==r&&Jt(h,Dt)&&(Gt(h,Dt),p.removeAttribute(i),p[i]=!1,ne.call(p,vt,n))}}setTimeout(function(){e=!1},50)}}};s in t||Zt(t,nt,a);for(var r=Kt(t,"btn"),c=r[Lt],u=0;u<c;u++)!Jt(r[u],Dt)&&Qt("input:checked",r[u])&&Ft(r[u],Dt);t[s]=this};ie(s,ue,n[yt]("["+o+'="buttons"]'));var fe=function(e,n){e=Qt(e),n=n||{};var i="false"!==e[mt](y)&&(parseInt(e[mt](y))||5e3),o=e[mt](C)===it||!1,l="true"===e[mt](w)||!1,a="carousel",r="paused",c="direction",s="carousel-item",f="data-slide-to";this[N]=n[N]===!0||l,this[j]=!(n[j]!==it&&!o)&&it,n[W]||i?this[W]=parseInt(n[W])||i:this[W]=!1;var d=this,h=e.index=0,p=e.timer=0,v=!1,m=Kt(e,s),g=m[Lt],b=this[c]=Bt,T=Kt(e,a+"-control-prev")[0],x=Kt(e,a+"-control-next")[0],A=Qt("."+a+"-indicators",e),E=A&&A[wt]("LI")||[],L=function(){d[W]===!1||Jt(e,r)||(Ft(e,r),!v&&clearInterval(p))},I=function(){d[W]!==!1&&Jt(e,r)&&(Gt(e,r),!v&&clearInterval(p),!v&&d.cycle())},k=function(t){if(t.preventDefault(),!v){var e=t[$];d.getActiveIndex();if(!e||Jt(e,Dt)||!e[mt](f))return!1;h=parseInt(e[mt](f),10),d.slideTo(h)}},M=function(t){if(t.preventDefault(),!v){var e=t.currentTarget||t.srcElement;e===x?h++:e===T&&h--,d.slideTo(h)}},S=function(t){if(!v){switch(t.which){case 39:h++;break;case 37:h--;break;default:return}d.slideTo(h)}},D=function(t){for(var e=0,n=E[Lt];e<n;e++)Gt(E[e],Dt);E[t]&&Ft(E[t],Dt)};this.cycle=function(){p=setInterval(function(){h++,d.slideTo(h)},this[W])},this.slideTo=function(t){if(!v){var n,i=this.getActiveIndex();i<t||0===i&&t===g-1?b=d[c]=Bt:(i>t||i===g-1&&0===t)&&(b=d[c]=Pt),t<0?t=g-1:t===g&&(t=0),h=t,n=b===Bt?"next":"prev",ne.call(e,pt,a,m[t]),v=!0,clearInterval(p),D(t),Ut&&Jt(e,"slide")?(Ft(m[t],s+"-"+n),m[t][J],Ft(m[t],s+"-"+b),Ft(m[i],s+"-"+b),te(m[i],Xt,function(o){var l=o[$]!==m[i]?1e3*o.elapsedTime:0;setTimeout(function(){v=!1,Ft(m[t],Dt),Gt(m[i],Dt),Gt(m[t],s+"-"+n),Gt(m[t],s+"-"+b),Gt(m[i],s+"-"+b),ne.call(e,ht,a,m[t]),document.hidden||!d[W]||Jt(e,r)||d.cycle()},l+100)})):(Ft(m[t],Dt),m[t][J],Gt(m[i],Dt),setTimeout(function(){v=!1,d[W]&&!Jt(e,r)&&d.cycle(),ne.call(e,ht,a,m[t])},100))}},this.getActiveIndex=function(){return m[Ct](Kt(e,s+" active")[0])||0},u in e||(this[j]&&this[W]&&(Zt(e,qt[0],L),Zt(e,qt[1],I),Zt(e,"touchstart",L),Zt(e,"touchend",I)),x&&Zt(x,nt,M),T&&Zt(T,nt,M),A&&Zt(A,nt,k,!1),this[N]===!0&&Zt(t,ot,S,!1)),this.getActiveIndex()<0&&(m[Lt]&&Ft(m[0],Dt),E[Lt]&&D(0)),this[W]&&this.cycle(),e[u]=this};ie(u,fe,n[yt]("["+r+'="carousel"]'));var de=function(t,e){t=Qt(t),e=e||{};var n=null,i=null,l=this,a=!1,r=t[mt]("data-parent"),c="collapse",s="collapsed",u=function(t){ne.call(t,rt,c),a=!0,Ft(t,Nt),Gt(t,c),t[St][_]=t[Z]+"px",ee(t,function(){a=!1,t[gt](tt,"true"),Gt(t,Nt),Ft(t,c),Ft(t,Ht),t[St][_]="",ne.call(t,ct,c)})},d=function(t){ne.call(t,st,c),a=!0,t[St][_]=t[Z]+"px",Gt(t,c),Gt(t,Ht),Ft(t,Nt),t[J],t[St][_]="0px",ee(t,function(){a=!1,t[gt](tt,"false"),Gt(t,Nt),Ft(t,c),t[St][_]="",ne.call(t,ut,c)})},h=function(){var e=t.href&&t[mt]("href"),n=t[mt](T),i=e||n&&oe.test(n)&&n;return i&&Qt(i)};this.toggle=function(t){t.preventDefault(),a||(Jt(i,Ht)?l.hide():l.show())},this.hide=function(){d(i),Ft(t,s)},this.show=function(){if(n){var e=Qt("."+c+"."+Ht,n),l=e&&(Qt("["+o+'="'+c+'"]['+T+'="#'+e.id+'"]',n)||Qt("["+o+'="'+c+'"][href="#'+e.id+'"]',n)),a=l&&(l[mt](T)||l.href);e&&l&&e!==i&&(d(e),a.split("#")[1]!==i.id?Ft(l,s):Gt(l,s))}u(i),Gt(t,s)},f in t||Zt(t,nt,this.toggle),i=h(),n=Qt(e.parent)||r&&Vt(t,r),t[f]=this};ie(f,de,n[yt]("["+o+'="collapse"]'));var he=function(t,e){t=Qt(t),this.persist=e===!0||"true"===t[mt]("data-persist")||!1;var i=this,l=t[At],a="dropdown",r="open",c=null,s=Qt(".dropdown-menu",l),u=function(t){(/\#$/.test(t.href)||t[At]&&/\#$/.test(t[At].href))&&this[Et]()},f=function(){var e=t[r]?Zt:_t;e(n,ot,p),e(n,nt,h)},h=function(e){var n=e[$],l=n&&(n[mt](o)||n[At]&&mt in n[At]&&n[At][mt](o));(n!==s&&!s.contains(n)||!i.persist&&!l)&&(c=n===t||t.contains(n)?t:null,g(),u.call(e,n))},p=function(e){t[r]&&27===e.which&&(c=null,g())},v=function(e){c=t,m(),u.call(e,e[$])},m=function(){ne.call(l,rt,a,c),Ft(s,Ht),Ft(l,Ht),s[gt](tt,!0),ne.call(l,ct,a,c),t[r]=!0,_t(t,nt,v),setTimeout(function(){f()},1)},g=function(){ne.call(l,st,a,c),Gt(s,Ht),Gt(l,Ht),s[gt](tt,!1),ne.call(l,ut,a,c),t[r]=!1,f(),setTimeout(function(){Zt(t,nt,v)},1)};t[r]=!1,this.toggle=function(){Jt(l,Ht)&&t[r]?g():m()},d in t||(s[gt]("tabindex","0"),Zt(t,nt,v)),t[d]=this};ie(d,he,n[yt]("["+o+'="dropdown"]'));var pe=function(o,a){o=Qt(o);var r=o[mt](T)||o[mt]("href"),c=Qt(r),s=Jt(o,"modal")?o:c,u="modal",f="static",d="paddingLeft",p="paddingRight",v="modal-backdrop";if(Jt(o,"modal")&&(o=null),s){a=a||{},this[N]=a[N]!==!1&&"false"!==s[mt](w),this[H]=a[H]!==f&&s[mt](b)!==f||f,this[H]=a[H]!==!1&&"false"!==s[mt](b)&&this[H],this[P]=a[P];var m,g,y,x,C=this,A=null,E=Kt(e,jt).concat(Kt(e,Ot)),L=function(){var n=e[Tt]();return t[Q]||n[Pt]-Math.abs(n[Bt])},I=function(){var e,o=t.getComputedStyle(n[i]),l=parseInt(o[p],10);if(m&&(n[i][St][p]=l+y+"px",E[Lt]))for(var a=0;a<E[Lt];a++)e=t.getComputedStyle(E[a])[p],E[a][St][p]=parseInt(e)+y+"px"},k=function(){if(n[i][St][p]="",E[Lt])for(var t=0;t<E[Lt];t++)E[t][St][p]=""},M=function(){var t,e=document.createElement("div");return e.className=u+"-scrollbar-measure",n[i].appendChild(e),t=e[J]-e[F],n[i].removeChild(e),t},S=function(){m=n[i][F]<L(),g=s[Z]>e[G],y=M()},D=function(){s[St][d]=!m&&g?y+"px":"",s[St][p]=m&&!g?y+"px":""},B=function(){s[St][d]="",s[St][p]=""},W=function(){zt=1;var t=document.createElement("div");x=Qt("."+v),null===x&&(t[gt]("class",v+" fade"),x=t,n[i].appendChild(x))},j=function(){x=Qt("."+v),x&&null!==x&&"object"==typeof x&&(zt=0,n[i].removeChild(x),x=null),ne.call(s,ut,u)},O=function(){Jt(s,Ht)?Zt(document,ot,Y):_t(document,ot,Y)},q=function(){Jt(s,Ht)?Zt(t,lt,C.update):_t(t,lt,C.update)},R=function(){Jt(s,Ht)?Zt(s,nt,K):_t(s,nt,K)},z=function(){Yt(s),ne.call(s,ct,u,A)},U=function(){s[St].display="",o&&Yt(o),setTimeout(function(){Kt(document,u+" "+Ht)[0]||(B(),k(),Gt(n[i],u+"-open"),x&&Jt(x,"fade")?(Gt(x,Ht),ee(x,j)):j(),q(),R(),O())},50)},X=function(t){var e=t[$];e=e[bt](T)||e[bt]("href")?e:e[At],e!==o||Jt(s,Ht)||(s.modalTrigger=o,A=o,C.show(),t.preventDefault())},Y=function(t){C[N]&&27==t.which&&Jt(s,Ht)&&C.hide()},K=function(t){var e=t[$];Jt(s,Ht)&&(e[At][mt](l)===u||e[mt](l)===u||e===s&&C[H]!==f)&&(C.hide(),A=null,t.preventDefault())};this.toggle=function(){Jt(s,Ht)?this.hide():this.show()},this.show=function(){ne.call(s,rt,u,A);var t=Kt(document,u+" "+Ht)[0];t&&t!==s&&t.modalTrigger[h].hide(),this[H]&&!zt&&W(),x&&zt&&!Jt(x,Ht)&&(x[J],Ft(x,Ht)),setTimeout(function(){s[St].display="block",S(),I(),D(),Ft(n[i],u+"-open"),Ft(s,Ht),s[gt](et,!1),q(),R(),O(),Jt(s,"fade")?ee(s,z):z()},Ut?150:0)},this.hide=function(){ne.call(s,st,u),x=Qt("."+v),Gt(s,Ht),s[gt](et,!0),setTimeout(function(){Jt(s,"fade")?ee(s,U):U()},Ut?150:0)},this.setContent=function(t){Qt("."+u+"-content",s).innerHTML=t},this.update=function(){Jt(s,Ht)&&(S(),I(),D())},!o||h in o||Zt(o,nt,X),this[P]&&this.setContent(this[P]),!!o&&(o[h]=this)}};ie(h,pe,n[yt]("["+o+'="modal"]'));var ve=function(e,o){e=Qt(e);var l=e[mt](I),a=e[mt](k),r=e[mt](S),c=e[mt](L),s=e[mt](D),u=e[mt](M),f="popover",d="template",h="trigger",v="class",m="div",g="fade",b="data-content",w="dismissible",T='<button type="button" class="close">×</button>',y=Vt(e,".modal"),x=Vt(e,"."+jt),C=Vt(e,"."+Ot);o=o||{},this[d]=o[d]?o[d]:null,this[h]=o[h]?o[h]:l||it,this[O]=o[O]&&o[O]!==g?o[O]:a||g,this[q]=o[q]?o[q]:r||$t,this[B]=parseInt(o[B]||s)||200,this[w]=!(!o[w]&&"true"!==c),this[R]=Qt(o[R])?Qt(o[R]):Qt(u)?Qt(u):x?x:C?C:y?y:n[i];var E=this,H=e[mt](A)||null,N=e[mt](b)||null;if(N||this[d]){var P=null,W=0,j=this[q],z=function(t){null!==P&&t[$]===Qt(".close",P)&&E.hide()},U=function(){E[R].removeChild(P),W=null,P=null},X=function(){H=e[mt](A),N=e[mt](b),P=document.createElement(m);var t=document.createElement(m);if(t[gt](v,"arrow"),P.appendChild(t),null!==N&&null===E[d]){if(P[gt]("role","tooltip"),null!==H){var n=document.createElement("h3");n[gt](v,f+"-header"),n.innerHTML=E[w]?H+T:H,P.appendChild(n)}var i=document.createElement(m);i[gt](v,f+"-body"),i.innerHTML=E[w]&&null===H?N+T:N,P.appendChild(i)}else{var o=document.createElement(m);o.innerHTML=E[d],P.innerHTML=o.firstChild.innerHTML}E[R].appendChild(P),P[St].display="block",P[gt](v,f+" bs-"+f+"-"+j+" "+E[O])},Y=function(){!Jt(P,Ht)&&Ft(P,Ht)},F=function(){re(e,P,j,E[R]),le(P)||(j=ce(j),re(e,P,j,E[R]))},G=function(n){/^(click|focus)$/.test(E[h])&&!E[w]&&n(e,"blur",E.hide),E[w]&&n(document,nt,z),n(t,lt,E.hide)},J=function(){G(Zt),ne.call(e,ct,f)},K=function(){G(_t),U(),ne.call(e,ut,f)};this.toggle=function(){null===P?E.show():E.hide()},this.show=function(){clearTimeout(W),W=setTimeout(function(){null===P&&(j=E[q],X(),F(),Y(),ne.call(e,rt,f),E[O]?ee(P,J):J())},20)},this.hide=function(){clearTimeout(W),W=setTimeout(function(){P&&null!==P&&Jt(P,Ht)&&(ne.call(e,st,f),Gt(P,Ht),E[O]?ee(P,K):K())},E[B])},p in e||(E[h]===it?(Zt(e,qt[0],E.show),E[w]||Zt(e,qt[1],E.hide)):/^(click|focus)$/.test(E[h])&&Zt(e,E[h],E.toggle)),e[p]=E}};ie(p,ve,n[yt]("["+o+'="popover"]'));var me=function(e,n){e=Qt(e);var i=Qt(e[mt](T)),o=e[mt]("data-offset");if(n=n||{},n[$]||i){for(var l,a=n[$]&&Qt(n[$])||i,r=a&&a[wt]("A"),c=parseInt(o||n.offset)||10,s=[],u=[],f=e[K]<e[Z]?e:t,d=f===t,h=0,p=r[Lt];h<p;h++){var m=r[h][mt]("href"),g=m&&oe.test(m)&&Qt(m);g&&(s.push(r[h]),u.push(g))}var b=function(t){var n=s[t],i=u[t],o=n[At][At],a=Jt(o,"dropdown")&&o[wt]("A")[0],r=d&&i[Tt](),f=Jt(n,Dt)||!1,h=(d?r[$t]+l:i[z])-c,p=d?r[Wt]+l-c:u[t+1]?u[t+1][z]-c:e[Z],v=l>=h&&p>l;if(!f&&v)Jt(n,Dt)||(Ft(n,Dt),f=!0,a&&!Jt(a,Dt)&&Ft(a,Dt),ne.call(e,"activate","scrollspy",s[t]));else if(v){if(!v&&!f||f&&v)return}else Jt(n,Dt)&&(Gt(n,Dt),f=!1,a&&Jt(a,Dt)&&!Kt(n[At],Dt).length&&Gt(a,Dt))},w=function(){l=d?ae().y:e[X];for(var t=0,n=s[Lt];t<n;t++)b(t)};this.refresh=function(){w()},v in e||(Zt(f,at,this.refresh),Zt(t,lt,this.refresh)),this.refresh(),e[v]=this}};ie(v,me,n[yt]("["+a+'="scroll"]'));var ge=function(t,e){t=Qt(t);var n=t[mt](x),i="tab",l="height",a="float",r="isAnimating";e=e||{},this[l]=!!Ut&&(e[l]||"true"===n);var c,s,u,f,d,h,p,v=this,g=Vt(t,".nav"),b=!1,w=g&&Qt(".dropdown-toggle",g),T=function(){b[St][l]="",Gt(b,Nt),g[r]=!1},y=function(){b?h?T():setTimeout(function(){b[St][l]=p+"px",b[J],ee(b,T)},1):g[r]=!1,ne.call(c,ct,i,s)},C=function(){b&&(u[St][a]="left",f[St][a]="left",d=u[Z]),Ft(f,Dt),ne.call(c,rt,i,s),Gt(u,Dt),ne.call(s,ut,i,c),b&&(p=f[Z],h=p===d,Ft(b,Nt),b[St][l]=d+"px",b[K],u[St][a]="",f[St][a]=""),Jt(f,"fade")?(Ft(f,Ht),ee(f,y)):y()};if(g){g[r]=!1;var A=function(){var t,e=Kt(g,Dt);return 1!==e[Lt]||Jt(e[0][At],"dropdown")?e[Lt]>1&&(t=e[e[Lt]-1]):t=e[0],t},E=function(){return Qt(A()[mt]("href"))},L=function(t){t.preventDefault(),c=t[$][mt](o)===i||oe.test(t[$][mt]("href"))?t[$]:t[$][At],!g[r]&&!Jt(c,Dt)&&v.show()};this.show=function(){c=c||t,f=Qt(c[mt]("href")),s=A(),u=E(),g[r]=!0,Gt(s,Dt),Ft(c,Dt),w&&(Jt(t[At],"dropdown-menu")?Jt(w,Dt)||Ft(w,Dt):Jt(w,Dt)&&Gt(w,Dt)),ne.call(s,st,i,c),Jt(u,"fade")?(Gt(u,Ht),ee(u,C)):C()},m in t||Zt(t,nt,L),this[l]&&(b=E()[At]),t[m]=this}};ie(m,ge,n[yt]("["+o+'="tab"]'));var be=function(e,o){e=Qt(e);var l=e[mt](k),a=e[mt](S),r=e[mt](D),c=e[mt](M),s="tooltip",u="class",f="title",d="fade",h="div",p=Vt(e,".modal"),v=Vt(e,"."+jt),m=Vt(e,"."+Ot);o=o||{},this[O]=o[O]&&o[O]!==d?o[O]:l||d,this[q]=o[q]?o[q]:a||$t,this[B]=parseInt(o[B]||r)||200,this[R]=Qt(o[R])?Qt(o[R]):Qt(c)?Qt(c):v?v:m?m:p?p:n[i];var b=this,w=0,T=this[q],y=null,x=e[mt](f)||e[mt](A)||e[mt](E);if(x&&""!=x){var C=function(){b[R].removeChild(y),y=null,w=null},L=function(){if(x=e[mt](f)||e[mt](A)||e[mt](E),!x||""==x)return!1;y=document.createElement(h),y[gt]("role",s);var t=document.createElement(h);t[gt](u,"arrow"),y.appendChild(t);var n=document.createElement(h);n[gt](u,s+"-inner"),y.appendChild(n),n.innerHTML=x,b[R].appendChild(y),y[gt](u,s+" bs-"+s+"-"+T+" "+b[O])},I=function(){re(e,y,T,b[R]),le(y)||(T=ce(T),re(e,y,T,b[R]))},H=function(){!Jt(y,Ht)&&Ft(y,Ht)},N=function(){Zt(t,lt,b.hide),ne.call(e,ct,s)},P=function(){_t(t,lt,b.hide),C(),ne.call(e,ut,s)};this.show=function(){clearTimeout(w),w=setTimeout(function(){if(null===y){if(T=b[q],0==L())return;I(),H(),ne.call(e,rt,s),b[O]?ee(y,N):N()}},20)},this.hide=function(){clearTimeout(w),w=setTimeout(function(){y&&null!==y&&Jt(y,Ht)&&(ne.call(e,st,s),Gt(y,Ht),b[O]?ee(y,P):P())},b[B])},this.toggle=function(){y?b.hide():b.show()},g in e||(e[gt](E,x),e.removeAttribute(f),Zt(e,qt[0],this.show),Zt(e,qt[1],this.hide)),e[g]=this}};return ie(g,be,n[yt]("["+o+'="tooltip"]')),{Alert:se,Button:ue,Carousel:fe,Collapse:de,Dropdown:he,Modal:pe,Popover:ve,ScrollSpy:me,Tab:ge,Tooltip:be}}); | ||
// Native Javascript for Bootstrap 4 v2.0.19 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){"use strict";var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document,i="body",o="data-toggle",l="data-dismiss",a="data-spy",c="data-ride",r="Alert",s="Button",u="Carousel",f="Collapse",d="Dropdown",h="Modal",p="Popover",v="ScrollSpy",m="Tab",g="Tooltip",w="data-backdrop",b="data-keyboard",T="data-target",y="data-interval",x="data-height",C="data-pause",A="data-title",E="data-original-title",L="data-dismissible",I="data-trigger",k="data-animation",M="data-container",S="data-placement",H="data-delay",N="backdrop",B="keyboard",D="delay",P="content",$="target",W="interval",j="pause",O="animation",q="placement",R="container",z="offsetTop",U="offsetLeft",X="scrollTop",Y="scrollLeft",F="clientWidth",G="clientHeight",J="offsetWidth",K="offsetHeight",Q="innerWidth",V="innerHeight",Z="scrollHeight",_="height",tt="aria-expanded",et="aria-hidden",nt="click",it="hover",ot="keydown",lt="resize",at="scroll",ct="show",rt="shown",st="hide",ut="hidden",ft="close",dt="closed",ht="slid",pt="slide",vt="change",mt="getAttribute",gt="setAttribute",wt="hasAttribute",bt="getElementsByTagName",Tt="preventDefault",yt="getBoundingClientRect",xt="querySelectorAll",Ct="getElementsByClassName",At="indexOf",Et="parentNode",Lt="length",It="toLowerCase",kt="Transition",Mt="Webkit",St="style",Ht="active",Nt="show",Bt="collapsing",Dt="left",Pt="right",$t="top",Wt="bottom",jt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ot=/\b(top|bottom|left|right)+/,qt=0,Rt="fixed-top",zt="fixed-bottom",Ut=Mt+kt in e[St]||kt[It]()in e[St],Xt=Mt+kt in e[St]?Mt[It]()+kt+"End":kt[It]()+"end",Yt=function(t){t.focus?t.focus():t.setActive()},Ft=function(t,e){t.classList.add(e)},Gt=function(t,e){t.classList.remove(e)},Jt=function(t,e){return t.classList.contains(e)},Kt=function(t,e){return[].slice.call(t[Ct](e))},Qt=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},Vt=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[Et])if("."===n){if(null!==Qt(e,t[Et])&&Jt(t,e.replace(".","")))return t}else if("#"===n&&t.id===e.substr(1))return t;return!1},Zt=function(t,e,n){t.addEventListener(e,n,!1)},_t=function(t,e,n){t.removeEventListener(e,n,!1)},te=function(t,e,n){Zt(t,e,function i(o){n(o),_t(t,e,i)})},ee=function(t,e){Ut?te(t,Xt,function(t){e(t)}):e()},ne=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},ie=function(t,e,n){for(var i=0;i<n[Lt];i++)new e(n[i])},oe=/^\#(.)+$/,le=function(){return{y:t.pageYOffset||e[X],x:t.pageXOffset||e[Y]}},ae=function(t,o,l,a){var c,r,s,u,f={w:o[J],h:o[K]},d=e[F]||n[i][F],h=e[G]||n[i][G],p=t[yt](),v=a===n[i]?le():{x:a[U]+a[Y],y:a[z]+a[X]},m={w:p[Pt]-p[Dt],h:p[Wt]-p[$t]},g=Qt(".arrow",o),w=g[J],b=Jt(o,"popover"),T=p[$t]+m.h/2-f.h/2<0,y=p[Dt]+m.w/2-f.w/2<0,x=p[Dt]+f.w/2+m.w/2>=d,C=p[$t]+f.h/2+m.h/2>=h,A=p[$t]-f.h<0,E=p[Dt]-f.w<0,L=p[$t]+f.h+m.h>=h,I=p[Dt]+f.w+m.w>=d;l=(l===Dt||l===Pt)&&E&&I?$t:l,l=l===$t&&A?Wt:l,l=l===Wt&&L?$t:l,l=l===Dt&&E?Pt:l,l=l===Pt&&I?Dt:l,l===Dt||l===Pt?(l===Dt?r=p[Dt]+v.x-f.w:l===Pt&&(r=p[Dt]+v.x+m.w),T?(c=p[$t]+v.y,s=m.h/2-w/2):C?(c=p[$t]+v.y-f.h+m.h,s=f.h-m.h/2-w/2):(c=p[$t]+v.y-f.h/2+m.h/2,s=f.h/2-w/2)):l!==$t&&l!==Wt||(l===$t?c=p[$t]+v.y-f.h:l===Wt&&(c=p[$t]+v.y+m.h),y?(r=0,u=p[Dt]+m.w/2-w/2):x?(r=d-1.01*f.w,u=f.w-(d-p[Dt])+m.w/2-w/2):(r=p[Dt]+v.x-f.w/2+m.w/2,u=f.w/2-w/2)),c=l===$t&&b?c-w:c,r=l===Dt&&b?r-w:r,o[St][$t]=c+"px",o[St][Dt]=r+"px",s&&(g[St][$t]=s+"px"),u&&(g[St][Dt]=u+"px"),o.className[At](l)===-1&&(o.className=o.className.replace(Ot,l))},ce=function(t){t=Qt(t);var e=this,n="alert",i=Vt(t,"."+n),o=function(){Jt(i,"fade")?ee(i,c):c()},a=function(o){i=Vt(o[$],"."+n),t=Qt("["+l+'="'+n+'"]',i),t&&i&&(t===o[$]||t.contains(o[$]))&&e.close()},c=function(){ne.call(i,dt,n),_t(t,nt,a),i[Et].removeChild(i)};this.close=function(){i&&t&&Jt(i,Nt)&&(ne.call(i,ft,n),Gt(i,Nt),i&&o())},r in t||Zt(t,nt,a),t[r]=this};ie(r,ce,n[xt]("["+l+'="alert"]'));var re=function(t){t=Qt(t);var e=!1,n="button",i="checked",o="LABEL",l="INPUT",a=function(a){var c=a[$].tagName===o?a[$]:a[$][Et].tagName===o?a[$][Et]:null;if(c){var r=this,s=Kt(r,"btn"),u=c[bt](l)[0];if(u){if("checkbox"===u.type&&(u[i]?(Gt(c,Ht),u[mt](i),u.removeAttribute(i),u[i]=!1):(Ft(c,Ht),u[mt](i),u[gt](i,i),u[i]=!0),e||(e=!0,ne.call(u,vt,n),ne.call(t,vt,n))),"radio"===u.type&&!e&&!u[i]){Ft(c,Ht),u[gt](i,i),u[i]=!0,ne.call(u,vt,n),ne.call(t,vt,n),e=!0;for(var f=0,d=s[Lt];f<d;f++){var h=s[f],p=h[bt](l)[0];h!==c&&Jt(h,Ht)&&(Gt(h,Ht),p.removeAttribute(i),p[i]=!1,ne.call(p,vt,n))}}setTimeout(function(){e=!1},50)}}};s in t||Zt(t,nt,a);for(var c=Kt(t,"btn"),r=c[Lt],u=0;u<r;u++)!Jt(c[u],Ht)&&Qt("input:checked",c[u])&&Ft(c[u],Ht);t[s]=this};ie(s,re,n[xt]("["+o+'="buttons"]'));var se=function(n,i){n=Qt(n),i=i||{};var o="false"!==n[mt](y)&&(parseInt(n[mt](y))||5e3),l=n[mt](C)===it||!1,a="true"===n[mt](b)||!1,c="carousel",r="paused",s="direction",f="carousel-item",d="data-slide-to";this[B]=i[B]===!0||a,this[j]=!(i[j]!==it&&!l)&&it,i[W]||o?this[W]=parseInt(i[W])||o:this[W]=!1;var h=this,p=n.index=0,v=n.timer=0,m=!1,g=Kt(n,f),w=g[Lt],T=this[s]=Dt,x=Kt(n,c+"-control-prev")[0],A=Kt(n,c+"-control-next")[0],E=Qt("."+c+"-indicators",n),L=E&&E[bt]("LI")||[],I=function(){h[W]===!1||Jt(n,r)||(Ft(n,r),!m&&clearInterval(v))},k=function(){h[W]!==!1&&Jt(n,r)&&(Gt(n,r),!m&&clearInterval(v),!m&&h.cycle())},M=function(t){if(t[Tt](),!m){var e=t[$];h.getActiveIndex();if(!e||Jt(e,Ht)||!e[mt](d))return!1;p=parseInt(e[mt](d),10),h.slideTo(p)}},S=function(t){if(t[Tt](),!m){var e=t.currentTarget||t.srcElement;e===A?p++:e===x&&p--,h.slideTo(p)}},H=function(t){if(!m){switch(t.which){case 39:p++;break;case 37:p--;break;default:return}h.slideTo(p)}},N=function(){var i=n[yt](),o=t[V]||e[G];return i[$t]<=o&&i[Wt]>=0},D=function(t){for(var e=0,n=L[Lt];e<n;e++)Gt(L[e],Ht);L[t]&&Ft(L[t],Ht)};this.cycle=function(){v=setInterval(function(){N()&&(p++,h.slideTo(p))},this[W])},this.slideTo=function(t){if(!m){var e,i=this.getActiveIndex();i<t||0===i&&t===w-1?T=h[s]=Dt:(i>t||i===w-1&&0===t)&&(T=h[s]=Pt),t<0?t=w-1:t===w&&(t=0),p=t,e=T===Dt?"next":"prev",ne.call(n,pt,c,g[t]),m=!0,clearInterval(v),D(t),Ut&&Jt(n,"slide")?(Ft(g[t],f+"-"+e),g[t][J],Ft(g[t],f+"-"+T),Ft(g[i],f+"-"+T),te(g[i],Xt,function(o){var l=o[$]!==g[i]?1e3*o.elapsedTime:0;setTimeout(function(){m=!1,Ft(g[t],Ht),Gt(g[i],Ht),Gt(g[t],f+"-"+e),Gt(g[t],f+"-"+T),Gt(g[i],f+"-"+T),ne.call(n,ht,c,g[t]),document.hidden||!h[W]||Jt(n,r)||h.cycle()},l+100)})):(Ft(g[t],Ht),g[t][J],Gt(g[i],Ht),setTimeout(function(){m=!1,h[W]&&!Jt(n,r)&&h.cycle(),ne.call(n,ht,c,g[t])},100))}},this.getActiveIndex=function(){return g[At](Kt(n,f+" active")[0])||0},u in n||(this[j]&&this[W]&&(Zt(n,jt[0],I),Zt(n,jt[1],k),Zt(n,"touchstart",I),Zt(n,"touchend",k)),A&&Zt(A,nt,S),x&&Zt(x,nt,S),E&&Zt(E,nt,M,!1),this[B]===!0&&Zt(t,ot,H,!1)),this.getActiveIndex()<0&&(g[Lt]&&Ft(g[0],Ht),L[Lt]&&D(0)),this[W]&&this.cycle(),n[u]=this};ie(u,se,n[xt]("["+c+'="carousel"]'));var ue=function(t,e){t=Qt(t),e=e||{};var n=null,i=null,l=this,a=!1,c=t[mt]("data-parent"),r="collapse",s="collapsed",u=function(t){ne.call(t,ct,r),a=!0,Ft(t,Bt),Gt(t,r),t[St][_]=t[Z]+"px",ee(t,function(){a=!1,t[gt](tt,"true"),Gt(t,Bt),Ft(t,r),Ft(t,Nt),t[St][_]="",ne.call(t,rt,r)})},d=function(t){ne.call(t,st,r),a=!0,t[St][_]=t[Z]+"px",Gt(t,r),Gt(t,Nt),Ft(t,Bt),t[J],t[St][_]="0px",ee(t,function(){a=!1,t[gt](tt,"false"),Gt(t,Bt),Ft(t,r),t[St][_]="",ne.call(t,ut,r)})},h=function(){var e=t.href&&t[mt]("href"),n=t[mt](T),i=e||n&&oe.test(n)&&n;return i&&Qt(i)};this.toggle=function(t){t[Tt](),a||(Jt(i,Nt)?l.hide():l.show())},this.hide=function(){d(i),Ft(t,s)},this.show=function(){if(n){var e=Qt("."+r+"."+Nt,n),l=e&&(Qt("["+o+'="'+r+'"]['+T+'="#'+e.id+'"]',n)||Qt("["+o+'="'+r+'"][href="#'+e.id+'"]',n)),a=l&&(l[mt](T)||l.href);e&&l&&e!==i&&(d(e),a.split("#")[1]!==i.id?Ft(l,s):Gt(l,s))}u(i),Gt(t,s)},f in t||Zt(t,nt,this.toggle),i=h(),n=Qt(e.parent)||c&&Vt(t,c),t[f]=this};ie(f,ue,n[xt]("["+o+'="collapse"]'));var fe=function(t,e){t=Qt(t),this.persist=e===!0||"true"===t[mt]("data-persist")||!1;var i=this,l=t[Et],a="dropdown",c="open",r=null,s=Qt(".dropdown-menu",l),u=function(t){(/\#$/.test(t.href)||t[Et]&&/\#$/.test(t[Et].href))&&this[Tt]()},f=function(){var e=t[c]?Zt:_t;e(n,ot,p),e(n,nt,h)},h=function(e){var n=e[$],l=n&&(n[mt](o)||n[Et]&&mt in n[Et]&&n[Et][mt](o));(n!==s&&!s.contains(n)||!i.persist&&!l)&&(r=n===t||t.contains(n)?t:null,g(),u.call(e,n))},p=function(e){t[c]&&27===e.which&&(r=null,g())},v=function(e){r=t,m(),u.call(e,e[$])},m=function(){ne.call(l,ct,a,r),Ft(s,Nt),Ft(l,Nt),s[gt](tt,!0),ne.call(l,rt,a,r),t[c]=!0,_t(t,nt,v),setTimeout(function(){f()},1)},g=function(){ne.call(l,st,a,r),Gt(s,Nt),Gt(l,Nt),s[gt](tt,!1),ne.call(l,ut,a,r),t[c]=!1,f(),setTimeout(function(){Zt(t,nt,v)},1)};t[c]=!1,this.toggle=function(){Jt(l,Nt)&&t[c]?g():m()},d in t||(s[gt]("tabindex","0"),Zt(t,nt,v)),t[d]=this};ie(d,fe,n[xt]("["+o+'="dropdown"]'));var de=function(o,a){o=Qt(o);var c=o[mt](T)||o[mt]("href"),r=Qt(c),s=Jt(o,"modal")?o:r,u="modal",f="static",d="paddingLeft",p="paddingRight",v="modal-backdrop";if(Jt(o,"modal")&&(o=null),s){a=a||{},this[B]=a[B]!==!1&&"false"!==s[mt](b),this[N]=a[N]!==f&&s[mt](w)!==f||f,this[N]=a[N]!==!1&&"false"!==s[mt](w)&&this[N],this[P]=a[P];var m,g,y,x,C=this,A=null,E=Kt(e,Rt).concat(Kt(e,zt)),L=function(){var n=e[yt]();return t[Q]||n[Pt]-Math.abs(n[Dt])},I=function(){var e,o=t.getComputedStyle(n[i]),l=parseInt(o[p],10);if(m&&(n[i][St][p]=l+y+"px",E[Lt]))for(var a=0;a<E[Lt];a++)e=t.getComputedStyle(E[a])[p],E[a][St][p]=parseInt(e)+y+"px"},k=function(){if(n[i][St][p]="",E[Lt])for(var t=0;t<E[Lt];t++)E[t][St][p]=""},M=function(){var t,e=document.createElement("div");return e.className=u+"-scrollbar-measure",n[i].appendChild(e),t=e[J]-e[F],n[i].removeChild(e),t},S=function(){m=n[i][F]<L(),g=s[Z]>e[G],y=M()},H=function(){s[St][d]=!m&&g?y+"px":"",s[St][p]=m&&!g?y+"px":""},D=function(){s[St][d]="",s[St][p]=""},W=function(){qt=1;var t=document.createElement("div");x=Qt("."+v),null===x&&(t[gt]("class",v+" fade"),x=t,n[i].appendChild(x))},j=function(){x=Qt("."+v),x&&null!==x&&"object"==typeof x&&(qt=0,n[i].removeChild(x),x=null),ne.call(s,ut,u)},O=function(){Jt(s,Nt)?Zt(document,ot,Y):_t(document,ot,Y)},q=function(){Jt(s,Nt)?Zt(t,lt,C.update):_t(t,lt,C.update)},R=function(){Jt(s,Nt)?Zt(s,nt,K):_t(s,nt,K)},z=function(){Yt(s),ne.call(s,rt,u,A)},U=function(){s[St].display="",o&&Yt(o),setTimeout(function(){Kt(document,u+" "+Nt)[0]||(D(),k(),Gt(n[i],u+"-open"),x&&Jt(x,"fade")?(Gt(x,Nt),ee(x,j)):j(),q(),R(),O())},50)},X=function(t){var e=t[$];e=e[wt](T)||e[wt]("href")?e:e[Et],e!==o||Jt(s,Nt)||(s.modalTrigger=o,A=o,C.show(),t[Tt]())},Y=function(t){C[B]&&27==t.which&&Jt(s,Nt)&&C.hide()},K=function(t){var e=t[$];Jt(s,Nt)&&(e[Et][mt](l)===u||e[mt](l)===u||e===s&&C[N]!==f)&&(C.hide(),A=null,t[Tt]())};this.toggle=function(){Jt(s,Nt)?this.hide():this.show()},this.show=function(){ne.call(s,ct,u,A);var t=Kt(document,u+" "+Nt)[0];t&&t!==s&&t.modalTrigger[h].hide(),this[N]&&!qt&&W(),x&&qt&&!Jt(x,Nt)&&(x[J],Ft(x,Nt)),setTimeout(function(){s[St].display="block",S(),I(),H(),Ft(n[i],u+"-open"),Ft(s,Nt),s[gt](et,!1),q(),R(),O(),Jt(s,"fade")?ee(s,z):z()},Ut?150:0)},this.hide=function(){ne.call(s,st,u),x=Qt("."+v),Gt(s,Nt),s[gt](et,!0),setTimeout(function(){Jt(s,"fade")?ee(s,U):U()},Ut?150:0)},this.setContent=function(t){Qt("."+u+"-content",s).innerHTML=t},this.update=function(){Jt(s,Nt)&&(S(),I(),H())},!o||h in o||Zt(o,nt,X),this[P]&&this.setContent(this[P]),!!o&&(o[h]=this)}};ie(h,de,n[xt]("["+o+'="modal"]'));var he=function(e,o){e=Qt(e);var l=e[mt](I),a=e[mt](k),c=e[mt](S),r=e[mt](L),s=e[mt](H),u=e[mt](M),f="popover",d="template",h="trigger",v="class",m="div",g="fade",w="data-content",b="dismissible",T='<button type="button" class="close">×</button>',y=Vt(e,".modal"),x=Vt(e,"."+Rt),C=Vt(e,"."+zt);o=o||{},this[d]=o[d]?o[d]:null,this[h]=o[h]?o[h]:l||it,this[O]=o[O]&&o[O]!==g?o[O]:a||g,this[q]=o[q]?o[q]:c||$t,this[D]=parseInt(o[D]||s)||200,this[b]=!(!o[b]&&"true"!==r),this[R]=Qt(o[R])?Qt(o[R]):Qt(u)?Qt(u):x?x:C?C:y?y:n[i];var E=this,N=e[mt](A)||null,B=e[mt](w)||null;if(B||this[d]){var P=null,W=0,j=this[q],z=function(t){null!==P&&t[$]===Qt(".close",P)&&E.hide()},U=function(){E[R].removeChild(P),W=null,P=null},X=function(){N=e[mt](A),B=e[mt](w),P=document.createElement(m);var t=document.createElement(m);if(t[gt](v,"arrow"),P.appendChild(t),null!==B&&null===E[d]){if(P[gt]("role","tooltip"),null!==N){var n=document.createElement("h3");n[gt](v,f+"-header"),n.innerHTML=E[b]?N+T:N,P.appendChild(n)}var i=document.createElement(m);i[gt](v,f+"-body"),i.innerHTML=E[b]&&null===N?B+T:B,P.appendChild(i)}else{var o=document.createElement(m);o.innerHTML=E[d],P.innerHTML=o.firstChild.innerHTML}E[R].appendChild(P),P[St].display="block",P[gt](v,f+" bs-"+f+"-"+j+" "+E[O])},Y=function(){!Jt(P,Nt)&&Ft(P,Nt)},F=function(){ae(e,P,j,E[R])},G=function(n){/^(click|focus)$/.test(E[h])&&!E[b]&&n(e,"blur",E.hide),E[b]&&n(document,nt,z),n(t,lt,E.hide)},J=function(){G(Zt),ne.call(e,rt,f)},K=function(){G(_t),U(),ne.call(e,ut,f)};this.toggle=function(){null===P?E.show():E.hide()},this.show=function(){clearTimeout(W),W=setTimeout(function(){null===P&&(j=E[q],X(),F(),Y(),ne.call(e,ct,f),E[O]?ee(P,J):J())},20)},this.hide=function(){clearTimeout(W),W=setTimeout(function(){P&&null!==P&&Jt(P,Nt)&&(ne.call(e,st,f),Gt(P,Nt),E[O]?ee(P,K):K())},E[D])},p in e||(E[h]===it?(Zt(e,jt[0],E.show),E[b]||Zt(e,jt[1],E.hide)):/^(click|focus)$/.test(E[h])&&Zt(e,E[h],E.toggle)),e[p]=E}};ie(p,he,n[xt]("["+o+'="popover"]'));var pe=function(e,n){e=Qt(e);var i=Qt(e[mt](T)),o=e[mt]("data-offset");if(n=n||{},n[$]||i){for(var l,a=n[$]&&Qt(n[$])||i,c=a&&a[bt]("A"),r=parseInt(o||n.offset)||10,s=[],u=[],f=e[K]<e[Z]?e:t,d=f===t,h=0,p=c[Lt];h<p;h++){var m=c[h][mt]("href"),g=m&&oe.test(m)&&Qt(m);g&&(s.push(c[h]),u.push(g))}var w=function(t){var n=s[t],i=u[t],o=n[Et][Et],a=Jt(o,"dropdown")&&o[bt]("A")[0],c=d&&i[yt](),f=Jt(n,Ht)||!1,h=(d?c[$t]+l:i[z])-r,p=d?c[Wt]+l-r:u[t+1]?u[t+1][z]-r:e[Z],v=l>=h&&p>l;if(!f&&v)Jt(n,Ht)||(Ft(n,Ht),f=!0,a&&!Jt(a,Ht)&&Ft(a,Ht),ne.call(e,"activate","scrollspy",s[t]));else if(v){if(!v&&!f||f&&v)return}else Jt(n,Ht)&&(Gt(n,Ht),f=!1,a&&Jt(a,Ht)&&!Kt(n[Et],Ht).length&&Gt(a,Ht))},b=function(){l=d?le().y:e[X];for(var t=0,n=s[Lt];t<n;t++)w(t)};this.refresh=function(){b()},v in e||(Zt(f,at,this.refresh),Zt(t,lt,this.refresh)),this.refresh(),e[v]=this}};ie(v,pe,n[xt]("["+a+'="scroll"]'));var ve=function(t,e){t=Qt(t);var n=t[mt](x),i="tab",l="height",a="float",c="isAnimating";e=e||{},this[l]=!!Ut&&(e[l]||"true"===n);var r,s,u,f,d,h,p,v=this,g=Vt(t,".nav"),w=!1,b=g&&Qt(".dropdown-toggle",g),T=function(){w[St][l]="",Gt(w,Bt),g[c]=!1},y=function(){w?h?T():setTimeout(function(){w[St][l]=p+"px",w[J],ee(w,T)},1):g[c]=!1,ne.call(r,rt,i,s)},C=function(){w&&(u[St][a]=Dt,f[St][a]=Dt,d=u[Z]),Ft(f,Ht),ne.call(r,ct,i,s),Gt(u,Ht),ne.call(s,ut,i,r),w&&(p=f[Z],h=p===d,Ft(w,Bt),w[St][l]=d+"px",w[K],u[St][a]="",f[St][a]=""),Jt(f,"fade")?setTimeout(function(){Ft(f,Nt),ee(f,y)},20):y()};if(g){g[c]=!1;var A=function(){var t,e=Kt(g,Ht);return 1!==e[Lt]||Jt(e[0][Et],"dropdown")?e[Lt]>1&&(t=e[e[Lt]-1]):t=e[0],t},E=function(){return Qt(A()[mt]("href"))},L=function(t){t[Tt](),r=t[$][mt](o)===i||oe.test(t[$][mt]("href"))?t[$]:t[$][Et],!g[c]&&!Jt(r,Ht)&&v.show()};this.show=function(){r=r||t,f=Qt(r[mt]("href")),s=A(),u=E(),g[c]=!0,Gt(s,Ht),Ft(r,Ht),b&&(Jt(t[Et],"dropdown-menu")?Jt(b,Ht)||Ft(b,Ht):Jt(b,Ht)&&Gt(b,Ht)),ne.call(s,st,i,r),Jt(u,"fade")?(Gt(u,Nt),ee(u,C)):C()},m in t||Zt(t,nt,L),this[l]&&(w=E()[Et]),t[m]=this}};ie(m,ve,n[xt]("["+o+'="tab"]'));var me=function(e,o){e=Qt(e);var l=e[mt](k),a=e[mt](S),c=e[mt](H),r=e[mt](M),s="tooltip",u="class",f="title",d="fade",h="div",p=Vt(e,".modal"),v=Vt(e,"."+Rt),m=Vt(e,"."+zt);o=o||{},this[O]=o[O]&&o[O]!==d?o[O]:l||d,this[q]=o[q]?o[q]:a||$t,this[D]=parseInt(o[D]||c)||200,this[R]=Qt(o[R])?Qt(o[R]):Qt(r)?Qt(r):v?v:m?m:p?p:n[i];var w=this,b=0,T=this[q],y=null,x=e[mt](f)||e[mt](A)||e[mt](E);if(x&&""!=x){var C=function(){w[R].removeChild(y),y=null,b=null},L=function(){if(x=e[mt](f)||e[mt](A)||e[mt](E),!x||""==x)return!1;y=document.createElement(h),y[gt]("role",s);var t=document.createElement(h);t[gt](u,"arrow"),y.appendChild(t);var n=document.createElement(h);n[gt](u,s+"-inner"),y.appendChild(n),n.innerHTML=x,w[R].appendChild(y),y[gt](u,s+" bs-"+s+"-"+T+" "+w[O])},I=function(){ae(e,y,T,w[R])},N=function(){!Jt(y,Nt)&&Ft(y,Nt)},B=function(){Zt(t,lt,w.hide),ne.call(e,rt,s)},P=function(){_t(t,lt,w.hide),C(),ne.call(e,ut,s)};this.show=function(){clearTimeout(b),b=setTimeout(function(){if(null===y){if(T=w[q],0==L())return;I(),N(),ne.call(e,ct,s),w[O]?ee(y,B):B()}},20)},this.hide=function(){clearTimeout(b),b=setTimeout(function(){y&&null!==y&&Jt(y,Nt)&&(ne.call(e,st,s),Gt(y,Nt),w[O]?ee(y,P):P())},w[D])},this.toggle=function(){y?w.hide():w.show()},g in e||(e[gt](E,x),e.removeAttribute(f),Zt(e,jt[0],this.show),Zt(e,jt[1],this.hide)),e[g]=this}};return ie(g,me,n[xt]("["+o+'="tooltip"]')),{Alert:ce,Button:re,Carousel:se,Collapse:ue,Dropdown:fe,Modal:de,Popover:he,ScrollSpy:pe,Tab:ve,Tooltip:me}}); |
@@ -1,2 +0,2 @@ | ||
// Native Javascript for Bootstrap 3 v2.0.18 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Affix=n.Affix,t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){"use strict";var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document,i="body",o="data-toggle",a="data-dismiss",l="data-spy",r="data-ride",c="Affix",s="Alert",u="Button",f="Carousel",d="Collapse",h="Dropdown",p="Modal",v="Popover",m="ScrollSpy",g="Tab",b="Tooltip",x="data-backdrop",y="data-keyboard",T="data-target",w="data-interval",C="data-height",I="data-pause",A="data-title",L="data-original-title",E="data-original-text",k="data-dismissible",M="data-trigger",H="data-animation",S="data-container",N="data-placement",D="data-delay",B="data-offset-top",$="data-offset-bottom",P="backdrop",W="keyboard",j="delay",O="content",q="target",z="interval",R="pause",U="animation",X="placement",Y="container",F="offsetTop",G="offsetBottom",J="offsetLeft",K="scrollTop",Q="scrollLeft",V="clientWidth",Z="clientHeight",_="offsetWidth",tt="offsetHeight",et="innerWidth",nt="innerHeight",it="scrollHeight",ot="height",at="aria-expanded",lt="aria-hidden",rt="click",ct="hover",st="keydown",ut="resize",ft="scroll",dt="show",ht="shown",pt="hide",vt="hidden",mt="close",gt="closed",bt="slid",xt="slide",yt="change",Tt="getAttribute",wt="setAttribute",Ct="hasAttribute",It="getElementsByTagName",At="preventDefault",Lt="getBoundingClientRect",Et="querySelectorAll",kt="getElementsByClassName",Mt="indexOf",Ht="parentNode",St="length",Nt="toLowerCase",Dt="Transition",Bt="Webkit",$t="style",Pt="active",Wt="in",jt="collapsing",Ot="disabled",qt="loading",zt="left",Rt="right",Ut="top",Xt="bottom",Yt=!("opacity"in e[$t]),Ft="navbar-fixed-top",Gt="navbar-fixed-bottom",Jt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Kt=/\b(top|bottom|left|top)+/,Qt=0,Vt=Bt+Dt in e[$t]||Dt[Nt]()in e[$t],Zt=Bt+Dt in e[$t]?Bt[Nt]()+Dt+"End":Dt[Nt]()+"end",_t=function(t){t.focus?t.focus():t.setActive()},te=function(t,e){t.classList.add(e)},ee=function(t,e){t.classList.remove(e)},ne=function(t,e){return t.classList.contains(e)},ie=function(t){for(var e=[],n=0,i=t[St];n<i;n++)e.push(t[n]);return e},oe=function(t,e){var n=Yt?Et:kt;return ie(t[n](Yt?"."+e.replace(/\s(?=[a-z])/g,"."):e))},ae=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},le=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[Ht])if("."===n){if(null!==ae(e,t[Ht])&&ne(t,e.replace(".","")))return t}else if("#"===n&&t.id===e.substr(1))return t;return!1},re=function(t,e,n){t.addEventListener(e,n,!1)},ce=function(t,e,n){t.removeEventListener(e,n,!1)},se=function(t,e,n){re(t,e,function i(o){n(o),ce(t,e,i)})},ue=function(t,e){Vt?se(t,Zt,function(t){e(t)}):e()},fe=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},de=function(t,e,n){for(var i=0;i<n[St];i++)new e(n[i])},he=/^\#(.)+$/,pe=function(n){var i=n[Lt]();return i[Ut]>=0&&i[zt]>=0&&i[Xt]<=(t[nt]||e[Z])&&i[Rt]<=(t[et]||e[V])},ve=function(){return{y:t.pageYOffset||e[K],x:t.pageXOffset||e[Q]}},me=function(t,e,o,a){var l=t[Lt](),r=a===n[i]?ve():{x:a[J]+a[Q],y:a[F]+a[K]},c={w:l[Rt]-l[zt],h:l[Xt]-l[Ut]},s={w:e[_],h:e[tt]};o===Ut?(e[$t][Ut]=l[Ut]+r.y-s.h+"px",e[$t][zt]=l[zt]+r.x-s.w/2+c.w/2+"px"):o===Xt?(e[$t][Ut]=l[Ut]+r.y+c.h+"px",e[$t][zt]=l[zt]+r.x-s.w/2+c.w/2+"px"):o===zt?(e[$t][Ut]=l[Ut]+r.y-s.h/2+c.h/2+"px",e[$t][zt]=l[zt]+r.x-s.w+"px"):o===Rt&&(e[$t][Ut]=l[Ut]+r.y-s.h/2+c.h/2+"px",e[$t][zt]=l[zt]+r.x+c.w+"px"),e.className[Mt](o)===-1&&(e.className=e.className.replace(Kt,o))},ge=function(t){return t===Ut?Xt:t===Xt?Ut:t===zt?Rt:t===Rt?zt:t},be=function(o,a){o=ae(o),a=a||{};var l=o[Tt](T),r=o[Tt](B),s=o[Tt]($),u="affix",f="affixed",d="function",h="update",p="affix-top",v="affixed-top",m="affix-bottom",g="affixed-bottom";if(this[q]=a[q]?ae(a[q]):ae(l)||null,this[F]=a[F]?a[F]:parseInt(r)||0,this[G]=a[G]?a[G]:parseInt(s)||0,this[q]||this[F]||this[G]){var b,x,y,w,C,I,A=this,L=!1,E=!1,k=function(){return Math.max(n[i][it],n[i][tt],e[Z],e[it],e[tt])},M=function(){return null!==A[q]?A[q][Lt]()[Ut]+w:A[F]?parseInt(typeof A[F]===d?A[F]():A[F]||0):void 0},H=function(){if(A[G])return y-o[tt]-parseInt(typeof A[G]===d?A[G]():A[G]||0)},S=function(){y=k(),w=parseInt(ve().y,0),b=M(),x=H(),C=parseInt(b)-w<0&&w>parseInt(b),I=parseInt(x)-w<0&&w>parseInt(x)},N=function(){L||ne(o,u)||(fe.call(o,u,u),fe.call(o,p,u),te(o,u),L=!0,fe.call(o,f,u),fe.call(o,v,u))},D=function(){L&&ne(o,u)&&(ee(o,u),L=!1)},P=function(){E||ne(o,m)||(fe.call(o,u,u),fe.call(o,m,u),te(o,m),E=!0,fe.call(o,f,u),fe.call(o,g,u))},W=function(){E&&ne(o,m)&&(ee(o,m),E=!1)},j=function(){I?(C&&D(),P()):(W(),C?N():D())};this[h]=function(){S(),j()},c in o||(re(t,ft,A[h]),!Yt&&re(t,ut,A[h])),o[c]=this,this[h]()}};de(c,be,n[Et]("["+l+'="affix"]'));var xe=function(t){t=ae(t);var e=this,n="alert",i=le(t,"."+n),o=function(){ne(i,"fade")?ue(i,r):r()},l=function(o){i=le(o[q],"."+n),t=ae("["+a+'="'+n+'"]',i),t&&i&&(t===o[q]||t.contains(o[q]))&&e.close()},r=function(){fe.call(i,gt,n),ce(t,rt,l),i[Ht].removeChild(i)};this.close=function(){i&&t&&ne(i,Wt)&&(fe.call(i,mt,n),ee(i,Wt),i&&o())},s in t||re(t,rt,l),t[s]=this};de(s,xe,n[Et]("["+a+'="alert"]'));var ye=function(t,e){t=ae(t),e=e||null;var n=!1,i="button",o="checked",a="reset",l="LABEL",r="INPUT",c=function(){e&&e!==a&&(e===qt&&(te(t,Ot),t[wt](Ot,Ot),t[wt](E,t.innerHTML.replace(/^\s+|\s+$/g,""))),t.innerHTML=t[Tt]("data-"+e+"-text"))},s=function(){t[Tt](E)&&((ne(t,Ot)||t[Tt](Ot)===Ot)&&(ee(t,Ot),t.removeAttribute(Ot)),t.innerHTML=t[Tt](E))},f=function(e){var a=e[q].tagName===l?e[q]:e[q][Ht].tagName===l?e[q][Ht]:null;if(a){var c=this,s=oe(c,"btn"),u=a[It](r)[0];if(u){if("checkbox"===u.type&&(u[o]?(ee(a,Pt),u[Tt](o),u.removeAttribute(o),u[o]=!1):(te(a,Pt),u[Tt](o),u[wt](o,o),u[o]=!0),n||(n=!0,fe.call(u,yt,i),fe.call(t,yt,i))),"radio"===u.type&&!n&&!u[o]){te(a,Pt),u[wt](o,o),u[o]=!0,fe.call(u,yt,i),fe.call(t,yt,i),n=!0;for(var f=0,d=s[St];f<d;f++){var h=s[f],p=h[It](r)[0];h!==a&&ne(h,Pt)&&(ee(h,Pt),p.removeAttribute(o),p[o]=!1,fe.call(p,yt,i))}}setTimeout(function(){n=!1},50)}}};if(ne(t,"btn"))null!==e&&(e!==a?c():s());else{u in t||re(t,rt,f);for(var d=oe(t,"btn"),h=d[St],p=0;p<h;p++)!ne(d[p],Pt)&&ae("input",d[p])[Tt](o)&&te(d[p],Pt);t[u]=this}};de(u,ye,n[Et]("["+o+'="buttons"]'));var Te=function(e,n){e=ae(e),n=n||{};var i="false"!==e[Tt](w)&&(parseInt(e[Tt](w))||5e3),o=e[Tt](I)===ct||!1,a="true"===e[Tt](y)||!1,l="carousel",r="paused",c="direction",s="data-slide-to";this[W]=n[W]===!0||a,this[R]=!(n[R]!==ct&&!o)&&ct,n[z]||i?this[z]=parseInt(n[z])||i:this[z]=!1;var u=this,d=e.index=0,h=e.timer=0,p=!1,v=oe(e,"item"),m=v[St],g=this[c]=zt,b=oe(e,l+"-control"),x=b[0],T=b[1],C=ae("."+l+"-indicators",e),A=C&&C[It]("LI")||[],L=function(){u[z]===!1||ne(e,r)||(te(e,r),!p&&clearInterval(h))},E=function(){u[z]!==!1&&ne(e,r)&&(ee(e,r),!p&&clearInterval(h),!p&&u.cycle())},k=function(t){if(t.preventDefault(),!p){var e=t[q];u.getActiveIndex();if(!e||ne(e,Pt)||!e[Tt](s))return!1;d=parseInt(e[Tt](s),10),u.slideTo(d)}},M=function(t){if(t.preventDefault(),!p){var e=t.currentTarget||t.srcElement;e===T?d++:e===x&&d--,u.slideTo(d)}},H=function(t){if(!p){switch(t.which){case 39:d++;break;case 37:d--;break;default:return}u.slideTo(d)}},S=function(t){for(var e=0,n=A[St];e<n;e++)ee(A[e],Pt);A[t]&&te(A[t],Pt)};this.cycle=function(){h=setInterval(function(){d++,u.slideTo(d)},this[z])},this.slideTo=function(t){if(!p){var n,i=this.getActiveIndex();i<t||0===i&&t===m-1?g=u[c]=zt:(i>t||i===m-1&&0===t)&&(g=u[c]=Rt),t<0?t=m-1:t===m&&(t=0),d=t,n=g===zt?"next":"prev",fe.call(e,xt,l,v[t]),p=!0,clearInterval(h),S(t),Vt&&ne(e,"slide")?(te(v[t],n),v[t][_],te(v[t],g),te(v[i],g),se(v[i],Zt,function(o){var a=o[q]!==v[i]?1e3*o.elapsedTime:0;setTimeout(function(){p=!1,te(v[t],Pt),ee(v[i],Pt),ee(v[t],n),ee(v[t],g),ee(v[i],g),fe.call(e,bt,l,v[t]),u[z]&&!ne(e,r)&&u.cycle()},a+100)})):(te(v[t],Pt),v[t][_],ee(v[i],Pt),setTimeout(function(){p=!1,u[z]&&!ne(e,r)&&u.cycle(),fe.call(e,bt,l,v[t])},100))}},this.getActiveIndex=function(){return v[Mt](oe(e,"item active")[0])||0},f in e||(this[R]&&this[z]&&(re(e,Jt[0],L),re(e,Jt[1],E),re(e,"touchstart",L),re(e,"touchend",E)),T&&re(T,rt,M),x&&re(x,rt,M),C&&re(C,rt,k,!1),this[W]===!0&&re(t,st,H,!1)),this.getActiveIndex()<0&&(v[St]&&te(v[0],Pt),A[St]&&S(0)),this[z]&&this.cycle(),e[f]=this};de(f,Te,n[Et]("["+r+'="carousel"]'));var we=function(t,e){t=ae(t),e=e||{};var n=null,i=null,a=this,l=!1,r=t[Tt]("data-parent"),c="collapse",s="collapsed",u=function(t){fe.call(t,dt,c),l=!0,te(t,jt),ee(t,c),t[$t][ot]=t[it]+"px",ue(t,function(){l=!1,t[wt](at,"true"),ee(t,jt),te(t,c),te(t,Wt),t[$t][ot]="",fe.call(t,ht,c)})},f=function(t){fe.call(t,pt,c),l=!0,t[$t][ot]=t[it]+"px",ee(t,c),ee(t,Wt),te(t,jt),t[_],t[$t][ot]="0px",ue(t,function(){l=!1,t[wt](at,"false"),ee(t,jt),te(t,c),t[$t][ot]="",fe.call(t,vt,c)})},h=function(){var e=t.href&&t[Tt]("href"),n=t[Tt](T),i=e||n&&he.test(n)&&n;return i&&ae(i)};this.toggle=function(t){t.preventDefault(),l||(ne(i,Wt)?a.hide():a.show())},this.hide=function(){f(i),te(t,s)},this.show=function(){if(n){var e=ae("."+c+"."+Wt,n),a=e&&(ae("["+o+'="'+c+'"]['+T+'="#'+e.id+'"]',n)||ae("["+o+'="'+c+'"][href="#'+e.id+'"]',n)),l=a&&(a[Tt](T)||a.href);e&&a&&e!==i&&(f(e),l.split("#")[1]!==i.id?te(a,s):ee(a,s))}u(i),ee(t,s)},d in t||re(t,rt,this.toggle),i=h(),n=ae(e.parent)||r&&le(t,r),t[d]=this};de(d,we,n[Et]("["+o+'="collapse"]'));var Ce=function(t,e){t=ae(t),this.persist=e===!0||"true"===t[Tt]("data-persist")||!1;var i=this,a=t[Ht],l="dropdown",r="open",c=null,s=ae(".dropdown-menu",a),u=function(t){(/\#$/.test(t.href)||t[Ht]&&/\#$/.test(t[Ht].href))&&this[At]()},f=function(){var e=t[r]?re:ce;e(n,st,p),e(n,rt,d)},d=function(e){var n=e[q],a=n&&(n[Tt](o)||n[Ht]&&Tt in n[Ht]&&n[Ht][Tt](o));(n!==s&&!s.contains(n)||!i.persist&&!a)&&(c=n===t||t.contains(n)?t:null,g(),u.call(e,n))},p=function(e){!t[r]||27!==e.which&&27!==e.keyCode||(c=null,g())},v=function(e){c=t,m(),u.call(e,e[q])},m=function(){fe.call(a,dt,l,c),te(a,r),s[wt](at,!0),fe.call(a,ht,l,c),t[r]=!0,ce(t,rt,v),setTimeout(function(){f()},1)},g=function(){fe.call(a,pt,l,c),ee(a,r),s[wt](at,!1),fe.call(a,vt,l,c),t[r]=!1,f(),setTimeout(function(){re(t,rt,v)},1)};t[r]=!1,this.toggle=function(){ne(a,r)&&t[r]?g():m()},h in t||(s[wt]("tabindex","0"),re(t,rt,v)),t[h]=this};de(h,Ce,n[Et]("["+o+'="dropdown"]'));var Ie=function(o,l){o=ae(o);var r=o[Tt](T)||o[Tt]("href"),c=ae(r),s=ne(o,"modal")?o:c,u="modal",f="static",d="paddingLeft",h="paddingRight",v="modal-backdrop";if(ne(o,"modal")&&(o=null),s){l=l||{},this[W]=l[W]!==!1&&"false"!==s[Tt](y),this[P]=l[P]!==f&&s[Tt](x)!==f||f,this[P]=l[P]!==!1&&"false"!==s[Tt](x)&&this[P],this[O]=l[O];var m,g,b,w,C=this,I=null,A=oe(e,Ft).concat(oe(e,Gt)),L=function(){var n=e[Lt]();return t[et]||n[Rt]-Math.abs(n[zt])},E=function(){var e,o=n[i].currentStyle||t.getComputedStyle(n[i]),a=parseInt(o[h],10);if(m&&(n[i][$t][h]=a+b+"px",A[St]))for(var l=0;l<A[St];l++)e=(A[l].currentStyle||t.getComputedStyle(A[l]))[h],A[l][$t][h]=parseInt(e)+b+"px"},k=function(){if(n[i][$t][h]="",A[St])for(var t=0;t<A[St];t++)A[t][$t][h]=""},M=function(){var t,e=document.createElement("div");return e.className=u+"-scrollbar-measure",n[i].appendChild(e),t=e[_]-e[V],n[i].removeChild(e),t},H=function(){m=n[i][V]<L(),g=s[it]>e[Z],b=M()},S=function(){s[$t][d]=!m&&g?b+"px":"",s[$t][h]=m&&!g?b+"px":""},N=function(){s[$t][d]="",s[$t][h]=""},D=function(){Qt=1;var t=document.createElement("div");w=ae("."+v),null===w&&(t[wt]("class",v+" fade"),w=t,n[i].appendChild(w))},B=function(){w=ae("."+v),w&&null!==w&&"object"==typeof w&&(Qt=0,n[i].removeChild(w),w=null),fe.call(s,vt,u)},$=function(){ne(s,Wt)?re(document,st,Y):ce(document,st,Y)},j=function(){ne(s,Wt)?re(t,ut,C.update):ce(t,ut,C.update)},z=function(){ne(s,Wt)?re(s,rt,F):ce(s,rt,F)},R=function(){_t(s),fe.call(s,ht,u,I)},U=function(){s[$t].display="",o&&_t(o),setTimeout(function(){oe(document,u+" "+Wt)[0]||(N(),k(),ee(n[i],u+"-open"),w&&ne(w,"fade")?(ee(w,Wt),ue(w,B)):B(),j(),z(),$())},50)},X=function(t){var e=t[q];e=e[Ct](T)||e[Ct]("href")?e:e[Ht],e!==o||ne(s,Wt)||(s.modalTrigger=o,I=o,C.show(),t.preventDefault())},Y=function(t){var e=t.which||t.keyCode;C[W]&&27==e&&ne(s,Wt)&&C.hide()},F=function(t){var e=t[q];ne(s,Wt)&&(e[Ht][Tt](a)===u||e[Tt](a)===u||e===s&&C[P]!==f)&&(C.hide(),I=null,t.preventDefault())};this.toggle=function(){ne(s,Wt)?this.hide():this.show()},this.show=function(){fe.call(s,dt,u,I);var t=oe(document,u+" in")[0];t&&t!==s&&t.modalTrigger[p].hide(),this[P]&&!Qt&&D(),w&&Qt&&!ne(w,Wt)&&(w[_],te(w,Wt)),setTimeout(function(){s[$t].display="block",H(),E(),S(),te(n[i],u+"-open"),te(s,Wt),s[wt](lt,!1),j(),z(),$(),ne(s,"fade")?ue(s,R):R()},Vt?150:0)},this.hide=function(){fe.call(s,pt,u),w=ae("."+v),ee(s,Wt),s[wt](lt,!0),setTimeout(function(){ne(s,"fade")?ue(s,U):U()},Vt?150:0)},this.setContent=function(t){ae("."+u+"-content",s).innerHTML=t},this.update=function(){ne(s,Wt)&&(H(),E(),S())},!o||p in o||re(o,rt,X),this[O]&&this.setContent(this[O]),!!o&&(o[p]=this)}};de(p,Ie,n[Et]("["+o+'="modal"]'));var Ae=function(e,o){e=ae(e);var a=e[Tt](M),l=e[Tt](H),r=e[Tt](N),c=e[Tt](k),s=e[Tt](D),u=e[Tt](S),f="popover",d="template",h="trigger",p="class",m="div",g="fade",b="data-content",x="dismissible",y='<button type="button" class="close">×</button>',T=le(e,".modal"),w=le(e,"."+Ft),C=le(e,"."+Gt);o=o||{},this[d]=o[d]?o[d]:null,this[h]=o[h]?o[h]:a||ct,this[U]=o[U]&&o[U]!==g?o[U]:l||g,this[X]=o[X]?o[X]:r||Ut,this[j]=parseInt(o[j]||s)||200,this[x]=!(!o[x]&&"true"!==c),this[Y]=ae(o[Y])?ae(o[Y]):ae(u)?ae(u):w?w:C?C:T?T:n[i];var I=this,L=e[Tt](A)||null,E=e[Tt](b)||null;if(E||this[d]){var B=null,$=0,P=this[X],W=function(t){null!==B&&t[q]===ae(".close",B)&&I.hide()},O=function(){I[Y].removeChild(B),$=null,B=null},z=function(){if(L=e[Tt](A),E=e[Tt](b),B=document.createElement(m),null!==E&&null===I[d]){if(B[wt]("role","tooltip"),null!==L){var t=document.createElement("h3");t[wt](p,f+"-title"),t.innerHTML=I[x]?L+y:L,B.appendChild(t)}var n=document.createElement(m),i=document.createElement(m);n[wt](p,"arrow"),i[wt](p,f+"-content"),B.appendChild(n),B.appendChild(i),i.innerHTML=I[x]&&null===L?E+y:E}else{var o=document.createElement(m);o.innerHTML=I[d],B.innerHTML=o.firstChild.innerHTML}I[Y].appendChild(B),B[$t].display="block",B[wt](p,f+" "+P+" "+I[U])},R=function(){!ne(B,Wt)&&te(B,Wt)},F=function(){me(e,B,P,I[Y]),pe(B)||(P=ge(P),me(e,B,P,I[Y]))},G=function(n){/^(click|focus)$/.test(I[h])&&!I[x]&&n(e,"blur",I.hide),I[x]&&n(document,rt,W),!Yt&&n(t,ut,I.hide)},J=function(){G(re),fe.call(e,ht,f)},K=function(){G(ce),O(),fe.call(e,vt,f)};this.toggle=function(){null===B?I.show():I.hide()},this.show=function(){clearTimeout($),$=setTimeout(function(){null===B&&(P=I[X],z(),F(),R(),fe.call(e,dt,f),I[U]?ue(B,J):J())},20)},this.hide=function(){clearTimeout($),$=setTimeout(function(){B&&null!==B&&ne(B,Wt)&&(fe.call(e,pt,f),ee(B,Wt),I[U]?ue(B,K):K())},I[j])},v in e||(I[h]===ct?(re(e,Jt[0],I.show),I[x]||re(e,Jt[1],I.hide)):/^(click|focus)$/.test(I[h])&&re(e,I[h],I.toggle)),e[v]=I}};de(v,Ae,n[Et]("["+o+'="popover"]'));var Le=function(e,n){e=ae(e);var i=ae(e[Tt](T)),o=e[Tt]("data-offset");if(n=n||{},n[q]||i){for(var a,l=n[q]&&ae(n[q])||i,r=l&&l[It]("A"),c=parseInt(o||n.offset)||10,s=[],u=[],f=e[tt]<e[it]?e:t,d=f===t,h=0,p=r[St];h<p;h++){var v=r[h][Tt]("href"),g=v&&he.test(v)&&ae(v);g&&(s.push(r[h]),u.push(g))}var b=function(t){var n=s[t][Ht],i=u[t],o=le(n,".dropdown"),l=d&&i[Lt](),r=ne(n,Pt)||!1,f=(d?l[Ut]+a:i[F])-c,h=d?l[Xt]+a-c:u[t+1]?u[t+1][F]-c:e[it],p=a>=f&&h>a;if(!r&&p)"LI"!==n.tagName||ne(n,Pt)||(te(n,Pt),r=!0,o&&!ne(o,Pt)&&te(o,Pt),fe.call(e,"activate","scrollspy",s[t]));else if(p){if(!p&&!r||r&&p)return}else"LI"===n.tagName&&ne(n,Pt)&&(ee(n,Pt),r=!1,o&&ne(o,Pt)&&!oe(n[Ht],Pt).length&&ee(o,Pt))},x=function(){a=d?ve().y:e[K];for(var t=0,n=s[St];t<n;t++)b(t)};this.refresh=function(){x()},m in e||(re(f,ft,this.refresh),!Yt&&re(t,ut,this.refresh)),this.refresh(),e[m]=this}};de(m,Le,n[Et]("["+l+'="scroll"]'));var Ee=function(t,e){t=ae(t);var n=t[Tt](C),i="tab",a="height",l="float",r="isAnimating";e=e||{},this[a]=!!Vt&&(e[a]||"true"===n);var c,s,u,f,d,h,p,v=this,m=le(t,".nav"),b=!1,x=m&&ae(".dropdown",m),y=function(){b[$t][a]="",ee(b,jt),m[r]=!1},T=function(){b?h?y():setTimeout(function(){b[$t][a]=p+"px",b[_],ue(b,y)},1):m[r]=!1,fe.call(c,ht,i,s)},w=function(){b&&(u[$t][l]="left",f[$t][l]="left",d=u[it]),te(f,Pt),fe.call(c,dt,i,s),ee(u,Pt),fe.call(s,vt,i,c),b&&(p=f[it],h=p===d,te(b,jt),b[$t][a]=d+"px",b[tt],u[$t][l]="",f[$t][l]=""),ne(f,"fade")?(te(f,Wt),ue(f,T)):T()};if(m){m[r]=!1;var I=function(){var t,e=oe(m,Pt);return 1!==e[St]||ne(e[0],"dropdown")?e[St]>1&&(t=e[e[St]-1]):t=e[0],t[It]("A")[0]},A=function(){return ae(I()[Tt]("href"))},L=function(t){t.preventDefault(),c=t[q][Tt](o)===i||he.test(t[q][Tt]("href"))?t[q]:t[q][Ht],!m[r]&&!ne(c[Ht],Pt)&&v.show()};this.show=function(){c=c||t,f=ae(c[Tt]("href")),s=I(),u=A(),m[r]=!0,ee(s[Ht],Pt),te(c[Ht],Pt),x&&(ne(t[Ht][Ht],"dropdown-menu")?ne(x,Pt)||te(x,Pt):ne(x,Pt)&&ee(x,Pt)),fe.call(s,pt,i,c),ne(u,"fade")?(ee(u,Wt),ue(u,w)):w()},g in t||re(t,rt,L),this[a]&&(b=A()[Ht]),t[g]=this}};de(g,Ee,n[Et]("["+o+'="tab"]'));var ke=function(e,o){e=ae(e);var a=e[Tt](H),l=e[Tt](N),r=e[Tt](D),c=e[Tt](S),s="tooltip",u="class",f="title",d="fade",h="div",p=le(e,".modal"),v=le(e,"."+Ft),m=le(e,"."+Gt);o=o||{},this[U]=o[U]&&o[U]!==d?o[U]:a||d,this[X]=o[X]?o[X]:l||Ut,this[j]=parseInt(o[j]||r)||200,this[Y]=ae(o[Y])?ae(o[Y]):ae(c)?ae(c):v?v:m?m:p?p:n[i];var g=this,x=0,y=this[X],T=null,w=e[Tt](f)||e[Tt](A)||e[Tt](L);if(w&&""!=w){var C=function(){g[Y].removeChild(T),T=null,x=null},I=function(){if(w=e[Tt](f)||e[Tt](A)||e[Tt](L),!w||""==w)return!1;T=document.createElement(h),T[wt]("role",s);var t=document.createElement(h),n=document.createElement(h);t[wt](u,s+"-arrow"),n[wt](u,s+"-inner"),T.appendChild(t),T.appendChild(n),n.innerHTML=w,g[Y].appendChild(T),T[wt](u,s+" "+y+" "+g[U])},E=function(){me(e,T,y,g[Y]),pe(T)||(y=ge(y),me(e,T,y,g[Y]))},k=function(){!ne(T,Wt)&&te(T,Wt)},M=function(){fe.call(e,ht,s),!Yt&&re(t,ut,g.hide)},B=function(){!Yt&&ce(t,ut,g.hide),C(),fe.call(e,vt,s)};this.show=function(){clearTimeout(x),x=setTimeout(function(){if(null===T){if(y=g[X],0==I())return;E(),k(),fe.call(e,dt,s),g[U]?ue(T,M):M()}},20)},this.hide=function(){clearTimeout(x),x=setTimeout(function(){T&&null!==T&&ne(T,Wt)&&(fe.call(e,pt,s),ee(T,Wt),g[U]?ue(T,B):B())},g[j])},this.toggle=function(){T?g.hide():g.show()},b in e||(e[wt](L,w),e.removeAttribute(f),re(e,Jt[0],this.show),re(e,Jt[1],this.hide)),e[b]=this}};return de(b,ke,n[Et]("["+o+'="tooltip"]')),{Affix:be,Alert:xe,Button:ye,Carousel:Te,Collapse:we,Dropdown:Ce,Modal:Ie,Popover:Ae,ScrollSpy:Le,Tab:Ee,Tooltip:ke}}); | ||
// Native Javascript for Bootstrap 3 v2.0.19 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Affix=n.Affix,t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){"use strict";var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document,i="body",o="data-toggle",a="data-dismiss",l="data-spy",r="data-ride",c="Affix",s="Alert",u="Button",f="Carousel",d="Collapse",h="Dropdown",p="Modal",v="Popover",m="ScrollSpy",g="Tab",b="Tooltip",w="data-backdrop",y="data-keyboard",T="data-target",x="data-interval",C="data-height",I="data-pause",A="data-title",L="data-original-title",E="data-original-text",k="data-dismissible",M="data-trigger",H="data-animation",S="data-container",N="data-placement",B="data-delay",$="data-offset-top",D="data-offset-bottom",P="backdrop",W="keyboard",j="delay",O="content",q="target",z="interval",R="pause",U="animation",X="placement",Y="container",F="offsetTop",G="offsetBottom",J="offsetLeft",K="scrollTop",Q="scrollLeft",V="clientWidth",Z="clientHeight",_="offsetWidth",tt="offsetHeight",et="innerWidth",nt="innerHeight",it="scrollHeight",ot="height",at="aria-expanded",lt="aria-hidden",rt="click",ct="hover",st="keydown",ut="resize",ft="scroll",dt="show",ht="shown",pt="hide",vt="hidden",mt="close",gt="closed",bt="slid",wt="slide",yt="change",Tt="getAttribute",xt="setAttribute",Ct="hasAttribute",It="getElementsByTagName",At="preventDefault",Lt="getBoundingClientRect",Et="querySelectorAll",kt="getElementsByClassName",Mt="indexOf",Ht="parentNode",St="length",Nt="toLowerCase",Bt="Transition",$t="Webkit",Dt="style",Pt="active",Wt="in",jt="collapsing",Ot="disabled",qt="loading",zt="left",Rt="right",Ut="top",Xt="bottom",Yt=!("opacity"in e[Dt]),Ft="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Gt=/\b(top|bottom|left|right)+/,Jt=0,Kt="navbar-fixed-top",Qt="navbar-fixed-bottom",Vt=$t+Bt in e[Dt]||Bt[Nt]()in e[Dt],Zt=$t+Bt in e[Dt]?$t[Nt]()+Bt+"End":Bt[Nt]()+"end",_t=function(t){t.focus?t.focus():t.setActive()},te=function(t,e){t.classList.add(e)},ee=function(t,e){t.classList.remove(e)},ne=function(t,e){return t.classList.contains(e)},ie=function(t){for(var e=[],n=0,i=t[St];n<i;n++)e.push(t[n]);return e},oe=function(t,e){var n=Yt?Et:kt;return ie(t[n](Yt?"."+e.replace(/\s(?=[a-z])/g,"."):e))},ae=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},le=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[Ht])if("."===n){if(null!==ae(e,t[Ht])&&ne(t,e.replace(".","")))return t}else if("#"===n&&t.id===e.substr(1))return t;return!1},re=function(t,e,n){t.addEventListener(e,n,!1)},ce=function(t,e,n){t.removeEventListener(e,n,!1)},se=function(t,e,n){re(t,e,function i(o){n(o),ce(t,e,i)})},ue=function(t,e){Vt?se(t,Zt,function(t){e(t)}):e()},fe=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},de=function(t,e,n){for(var i=0;i<n[St];i++)new e(n[i])},he=/^\#(.)+$/,pe=function(){return{y:t.pageYOffset||e[K],x:t.pageXOffset||e[Q]}},ve=function(t,o,a,l){var r,c,s,u,f={w:o[_],h:o[tt]},d=e[V]||n[i][V],h=e[Z]||n[i][Z],p=t[Lt](),v=l===n[i]?pe():{x:l[J]+l[Q],y:l[F]+l[K]},m={w:p[Rt]-p[zt],h:p[Xt]-p[Ut]},g=ae('[class*="arrow"]',o),b=p[Ut]+m.h/2-f.h/2<0,w=p[zt]+m.w/2-f.w/2<0,y=p[zt]+f.w/2+m.w/2>=d,T=p[Ut]+f.h/2+m.h/2>=h,x=p[Ut]-f.h<0,C=p[zt]-f.w<0,I=p[Ut]+f.h+m.h>=h,A=p[zt]+f.w+m.w>=d;a=(a===zt||a===Rt)&&C&&A?Ut:a,a=a===Ut&&x?Xt:a,a=a===Xt&&I?Ut:a,a=a===zt&&C?Rt:a,a=a===Rt&&A?zt:a,a===zt||a===Rt?(a===zt?c=p[zt]+v.x-f.w:a===Rt&&(c=p[zt]+v.x+m.w),b?(r=p[Ut]+v.y,s=m.h/2):T?(r=p[Ut]+v.y-f.h+m.h,s=f.h-m.h/2):r=p[Ut]+v.y-f.h/2+m.h/2):a!==Ut&&a!==Xt||(a===Ut?r=p[Ut]+v.y-f.h:a===Xt&&(r=p[Ut]+v.y+m.h),w?(c=0,u=p[zt]+m.w/2):y?(c=d-1.01*f.w,u=f.w-(d-p[zt])+m.w/2):c=p[zt]+v.x-f.w/2+m.w/2),o[Dt][Ut]=r+"px",o[Dt][zt]=c+"px",s&&(g[Dt][Ut]=s+"px"),u&&(g[Dt][zt]=u+"px"),o.className[Mt](a)===-1&&(o.className=o.className.replace(Gt,a))},me=function(o,a){o=ae(o),a=a||{};var l=o[Tt](T),r=o[Tt]($),s=o[Tt](D),u="affix",f="affixed",d="function",h="update",p="affix-top",v="affixed-top",m="affix-bottom",g="affixed-bottom";if(this[q]=a[q]?ae(a[q]):ae(l)||null,this[F]=a[F]?a[F]:parseInt(r)||0,this[G]=a[G]?a[G]:parseInt(s)||0,this[q]||this[F]||this[G]){var b,w,y,x,C,I,A=this,L=!1,E=!1,k=function(){return Math.max(n[i][it],n[i][tt],e[Z],e[it],e[tt])},M=function(){return null!==A[q]?A[q][Lt]()[Ut]+x:A[F]?parseInt(typeof A[F]===d?A[F]():A[F]||0):void 0},H=function(){if(A[G])return y-o[tt]-parseInt(typeof A[G]===d?A[G]():A[G]||0)},S=function(){y=k(),x=parseInt(pe().y,0),b=M(),w=H(),C=parseInt(b)-x<0&&x>parseInt(b),I=parseInt(w)-x<0&&x>parseInt(w)},N=function(){L||ne(o,u)||(fe.call(o,u,u),fe.call(o,p,u),te(o,u),L=!0,fe.call(o,f,u),fe.call(o,v,u))},B=function(){L&&ne(o,u)&&(ee(o,u),L=!1)},P=function(){E||ne(o,m)||(fe.call(o,u,u),fe.call(o,m,u),te(o,m),E=!0,fe.call(o,f,u),fe.call(o,g,u))},W=function(){E&&ne(o,m)&&(ee(o,m),E=!1)},j=function(){I?(C&&B(),P()):(W(),C?N():B())};this[h]=function(){S(),j()},c in o||(re(t,ft,A[h]),!Yt&&re(t,ut,A[h])),o[c]=this,this[h]()}};de(c,me,n[Et]("["+l+'="affix"]'));var ge=function(t){t=ae(t);var e=this,n="alert",i=le(t,"."+n),o=function(){ne(i,"fade")?ue(i,r):r()},l=function(o){i=le(o[q],"."+n),t=ae("["+a+'="'+n+'"]',i),t&&i&&(t===o[q]||t.contains(o[q]))&&e.close()},r=function(){fe.call(i,gt,n),ce(t,rt,l),i[Ht].removeChild(i)};this.close=function(){i&&t&&ne(i,Wt)&&(fe.call(i,mt,n),ee(i,Wt),i&&o())},s in t||re(t,rt,l),t[s]=this};de(s,ge,n[Et]("["+a+'="alert"]'));var be=function(t,e){t=ae(t),e=e||null;var n=!1,i="button",o="checked",a="reset",l="LABEL",r="INPUT",c=function(){e&&e!==a&&(e===qt&&(te(t,Ot),t[xt](Ot,Ot),t[xt](E,t.innerHTML.replace(/^\s+|\s+$/g,""))),t.innerHTML=t[Tt]("data-"+e+"-text"))},s=function(){t[Tt](E)&&((ne(t,Ot)||t[Tt](Ot)===Ot)&&(ee(t,Ot),t.removeAttribute(Ot)),t.innerHTML=t[Tt](E))},f=function(e){var a=e[q].tagName===l?e[q]:e[q][Ht].tagName===l?e[q][Ht]:null;if(a){var c=this,s=oe(c,"btn"),u=a[It](r)[0];if(u){if("checkbox"===u.type&&(u[o]?(ee(a,Pt),u[Tt](o),u.removeAttribute(o),u[o]=!1):(te(a,Pt),u[Tt](o),u[xt](o,o),u[o]=!0),n||(n=!0,fe.call(u,yt,i),fe.call(t,yt,i))),"radio"===u.type&&!n&&!u[o]){te(a,Pt),u[xt](o,o),u[o]=!0,fe.call(u,yt,i),fe.call(t,yt,i),n=!0;for(var f=0,d=s[St];f<d;f++){var h=s[f],p=h[It](r)[0];h!==a&&ne(h,Pt)&&(ee(h,Pt),p.removeAttribute(o),p[o]=!1,fe.call(p,yt,i))}}setTimeout(function(){n=!1},50)}}};if(ne(t,"btn"))null!==e&&(e!==a?c():s());else{u in t||re(t,rt,f);for(var d=oe(t,"btn"),h=d[St],p=0;p<h;p++)!ne(d[p],Pt)&&ae("input",d[p])[Tt](o)&&te(d[p],Pt);t[u]=this}};de(u,be,n[Et]("["+o+'="buttons"]'));var we=function(n,i){n=ae(n),i=i||{};var o="false"!==n[Tt](x)&&(parseInt(n[Tt](x))||5e3),a=n[Tt](I)===ct||!1,l="true"===n[Tt](y)||!1,r="carousel",c="paused",s="direction",u="data-slide-to";this[W]=i[W]===!0||l,this[R]=!(i[R]!==ct&&!a)&&ct,i[z]||o?this[z]=parseInt(i[z])||o:this[z]=!1;var d=this,h=n.index=0,p=n.timer=0,v=!1,m=oe(n,"item"),g=m[St],b=this[s]=zt,w=oe(n,r+"-control"),T=w[0],C=w[1],A=ae("."+r+"-indicators",n),L=A&&A[It]("LI")||[],E=function(){d[z]===!1||ne(n,c)||(te(n,c),!v&&clearInterval(p))},k=function(){d[z]!==!1&&ne(n,c)&&(ee(n,c),!v&&clearInterval(p),!v&&d.cycle())},M=function(t){if(t[At](),!v){var e=t[q];d.getActiveIndex();if(!e||ne(e,Pt)||!e[Tt](u))return!1;h=parseInt(e[Tt](u),10),d.slideTo(h)}},H=function(t){if(t[At](),!v){var e=t.currentTarget||t.srcElement;e===C?h++:e===T&&h--,d.slideTo(h)}},S=function(t){if(!v){switch(t.which){case 39:h++;break;case 37:h--;break;default:return}d.slideTo(h)}},N=function(){var i=n[Lt](),o=t[nt]||e[Z];return i[Ut]<=o&&i[Xt]>=0},B=function(t){for(var e=0,n=L[St];e<n;e++)ee(L[e],Pt);L[t]&&te(L[t],Pt)};this.cycle=function(){p=setInterval(function(){N()&&(h++,d.slideTo(h))},this[z])},this.slideTo=function(t){if(!v){var e,i=this.getActiveIndex();i<t||0===i&&t===g-1?b=d[s]=zt:(i>t||i===g-1&&0===t)&&(b=d[s]=Rt),t<0?t=g-1:t===g&&(t=0),h=t,e=b===zt?"next":"prev",fe.call(n,wt,r,m[t]),v=!0,clearInterval(p),B(t),Vt&&ne(n,"slide")?(te(m[t],e),m[t][_],te(m[t],b),te(m[i],b),se(m[i],Zt,function(o){var a=o[q]!==m[i]?1e3*o.elapsedTime:0;setTimeout(function(){v=!1,te(m[t],Pt),ee(m[i],Pt),ee(m[t],e),ee(m[t],b),ee(m[i],b),fe.call(n,bt,r,m[t]),d[z]&&!ne(n,c)&&d.cycle()},a+100)})):(te(m[t],Pt),m[t][_],ee(m[i],Pt),setTimeout(function(){v=!1,d[z]&&!ne(n,c)&&d.cycle(),fe.call(n,bt,r,m[t])},100))}},this.getActiveIndex=function(){return m[Mt](oe(n,"item active")[0])||0},f in n||(this[R]&&this[z]&&(re(n,Ft[0],E),re(n,Ft[1],k),re(n,"touchstart",E),re(n,"touchend",k)),C&&re(C,rt,H),T&&re(T,rt,H),A&&re(A,rt,M,!1),this[W]===!0&&re(t,st,S,!1)),this.getActiveIndex()<0&&(m[St]&&te(m[0],Pt),L[St]&&B(0)),this[z]&&this.cycle(),n[f]=this};de(f,we,n[Et]("["+r+'="carousel"]'));var ye=function(t,e){t=ae(t),e=e||{};var n=null,i=null,a=this,l=!1,r=t[Tt]("data-parent"),c="collapse",s="collapsed",u=function(t){fe.call(t,dt,c),l=!0,te(t,jt),ee(t,c),t[Dt][ot]=t[it]+"px",ue(t,function(){l=!1,t[xt](at,"true"),ee(t,jt),te(t,c),te(t,Wt),t[Dt][ot]="",fe.call(t,ht,c)})},f=function(t){fe.call(t,pt,c),l=!0,t[Dt][ot]=t[it]+"px",ee(t,c),ee(t,Wt),te(t,jt),t[_],t[Dt][ot]="0px",ue(t,function(){l=!1,t[xt](at,"false"),ee(t,jt),te(t,c),t[Dt][ot]="",fe.call(t,vt,c)})},h=function(){var e=t.href&&t[Tt]("href"),n=t[Tt](T),i=e||n&&he.test(n)&&n;return i&&ae(i)};this.toggle=function(t){t[At](),l||(ne(i,Wt)?a.hide():a.show())},this.hide=function(){f(i),te(t,s)},this.show=function(){if(n){var e=ae("."+c+"."+Wt,n),a=e&&(ae("["+o+'="'+c+'"]['+T+'="#'+e.id+'"]',n)||ae("["+o+'="'+c+'"][href="#'+e.id+'"]',n)),l=a&&(a[Tt](T)||a.href);e&&a&&e!==i&&(f(e),l.split("#")[1]!==i.id?te(a,s):ee(a,s))}u(i),ee(t,s)},d in t||re(t,rt,this.toggle),i=h(),n=ae(e.parent)||r&&le(t,r),t[d]=this};de(d,ye,n[Et]("["+o+'="collapse"]'));var Te=function(t,e){t=ae(t),this.persist=e===!0||"true"===t[Tt]("data-persist")||!1;var i=this,a=t[Ht],l="dropdown",r="open",c=null,s=ae(".dropdown-menu",a),u=function(t){(/\#$/.test(t.href)||t[Ht]&&/\#$/.test(t[Ht].href))&&this[At]()},f=function(){var e=t[r]?re:ce;e(n,st,p),e(n,rt,d)},d=function(e){var n=e[q],a=n&&(n[Tt](o)||n[Ht]&&Tt in n[Ht]&&n[Ht][Tt](o));(n!==s&&!s.contains(n)||!i.persist&&!a)&&(c=n===t||t.contains(n)?t:null,g(),u.call(e,n))},p=function(e){!t[r]||27!==e.which&&27!==e.keyCode||(c=null,g())},v=function(e){c=t,m(),u.call(e,e[q])},m=function(){fe.call(a,dt,l,c),te(a,r),s[xt](at,!0),fe.call(a,ht,l,c),t[r]=!0,ce(t,rt,v),setTimeout(function(){f()},1)},g=function(){fe.call(a,pt,l,c),ee(a,r),s[xt](at,!1),fe.call(a,vt,l,c),t[r]=!1,f(),setTimeout(function(){re(t,rt,v)},1)};t[r]=!1,this.toggle=function(){ne(a,r)&&t[r]?g():m()},h in t||(s[xt]("tabindex","0"),re(t,rt,v)),t[h]=this};de(h,Te,n[Et]("["+o+'="dropdown"]'));var xe=function(o,l){o=ae(o);var r=o[Tt](T)||o[Tt]("href"),c=ae(r),s=ne(o,"modal")?o:c,u="modal",f="static",d="paddingLeft",h="paddingRight",v="modal-backdrop";if(ne(o,"modal")&&(o=null),s){l=l||{},this[W]=l[W]!==!1&&"false"!==s[Tt](y),this[P]=l[P]!==f&&s[Tt](w)!==f||f,this[P]=l[P]!==!1&&"false"!==s[Tt](w)&&this[P],this[O]=l[O];var m,g,b,x,C=this,I=null,A=oe(e,Kt).concat(oe(e,Qt)),L=function(){var n=e[Lt]();return t[et]||n[Rt]-Math.abs(n[zt])},E=function(){var e,o=n[i].currentStyle||t.getComputedStyle(n[i]),a=parseInt(o[h],10);if(m&&(n[i][Dt][h]=a+b+"px",A[St]))for(var l=0;l<A[St];l++)e=(A[l].currentStyle||t.getComputedStyle(A[l]))[h],A[l][Dt][h]=parseInt(e)+b+"px"},k=function(){if(n[i][Dt][h]="",A[St])for(var t=0;t<A[St];t++)A[t][Dt][h]=""},M=function(){var t,e=document.createElement("div");return e.className=u+"-scrollbar-measure",n[i].appendChild(e),t=e[_]-e[V],n[i].removeChild(e),t},H=function(){m=n[i][V]<L(),g=s[it]>e[Z],b=M()},S=function(){s[Dt][d]=!m&&g?b+"px":"",s[Dt][h]=m&&!g?b+"px":""},N=function(){s[Dt][d]="",s[Dt][h]=""},B=function(){Jt=1;var t=document.createElement("div");x=ae("."+v),null===x&&(t[xt]("class",v+" fade"),x=t,n[i].appendChild(x))},$=function(){x=ae("."+v),x&&null!==x&&"object"==typeof x&&(Jt=0,n[i].removeChild(x),x=null),fe.call(s,vt,u)},D=function(){ne(s,Wt)?re(document,st,Y):ce(document,st,Y)},j=function(){ne(s,Wt)?re(t,ut,C.update):ce(t,ut,C.update)},z=function(){ne(s,Wt)?re(s,rt,F):ce(s,rt,F)},R=function(){_t(s),fe.call(s,ht,u,I)},U=function(){s[Dt].display="",o&&_t(o),setTimeout(function(){oe(document,u+" "+Wt)[0]||(N(),k(),ee(n[i],u+"-open"),x&&ne(x,"fade")?(ee(x,Wt),ue(x,$)):$(),j(),z(),D())},50)},X=function(t){var e=t[q];e=e[Ct](T)||e[Ct]("href")?e:e[Ht],e!==o||ne(s,Wt)||(s.modalTrigger=o,I=o,C.show(),t[At]())},Y=function(t){var e=t.which||t.keyCode;C[W]&&27==e&&ne(s,Wt)&&C.hide()},F=function(t){var e=t[q];ne(s,Wt)&&(e[Ht][Tt](a)===u||e[Tt](a)===u||e===s&&C[P]!==f)&&(C.hide(),I=null,t[At]())};this.toggle=function(){ne(s,Wt)?this.hide():this.show()},this.show=function(){fe.call(s,dt,u,I);var t=oe(document,u+" in")[0];t&&t!==s&&t.modalTrigger[p].hide(),this[P]&&!Jt&&B(),x&&Jt&&!ne(x,Wt)&&(x[_],te(x,Wt)),setTimeout(function(){s[Dt].display="block",H(),E(),S(),te(n[i],u+"-open"),te(s,Wt),s[xt](lt,!1),j(),z(),D(),ne(s,"fade")?ue(s,R):R()},Vt?150:0)},this.hide=function(){fe.call(s,pt,u),x=ae("."+v),ee(s,Wt),s[xt](lt,!0),setTimeout(function(){ne(s,"fade")?ue(s,U):U()},Vt?150:0)},this.setContent=function(t){ae("."+u+"-content",s).innerHTML=t},this.update=function(){ne(s,Wt)&&(H(),E(),S())},!o||p in o||re(o,rt,X),this[O]&&this.setContent(this[O]),!!o&&(o[p]=this)}};de(p,xe,n[Et]("["+o+'="modal"]'));var Ce=function(e,o){e=ae(e);var a=e[Tt](M),l=e[Tt](H),r=e[Tt](N),c=e[Tt](k),s=e[Tt](B),u=e[Tt](S),f="popover",d="template",h="trigger",p="class",m="div",g="fade",b="data-content",w="dismissible",y='<button type="button" class="close">×</button>',T=le(e,".modal"),x=le(e,"."+Kt),C=le(e,"."+Qt);o=o||{},this[d]=o[d]?o[d]:null,this[h]=o[h]?o[h]:a||ct,this[U]=o[U]&&o[U]!==g?o[U]:l||g,this[X]=o[X]?o[X]:r||Ut,this[j]=parseInt(o[j]||s)||200,this[w]=!(!o[w]&&"true"!==c),this[Y]=ae(o[Y])?ae(o[Y]):ae(u)?ae(u):x?x:C?C:T?T:n[i];var I=this,L=e[Tt](A)||null,E=e[Tt](b)||null;if(E||this[d]){var $=null,D=0,P=this[X],W=function(t){null!==$&&t[q]===ae(".close",$)&&I.hide()},O=function(){I[Y].removeChild($),D=null,$=null},z=function(){if(L=e[Tt](A),E=e[Tt](b),$=document.createElement(m),null!==E&&null===I[d]){if($[xt]("role","tooltip"),null!==L){var t=document.createElement("h3");t[xt](p,f+"-title"),t.innerHTML=I[w]?L+y:L,$.appendChild(t)}var n=document.createElement(m),i=document.createElement(m);n[xt](p,"arrow"),i[xt](p,f+"-content"),$.appendChild(n),$.appendChild(i),i.innerHTML=I[w]&&null===L?E+y:E}else{var o=document.createElement(m);o.innerHTML=I[d],$.innerHTML=o.firstChild.innerHTML}I[Y].appendChild($),$[Dt].display="block",$[xt](p,f+" "+P+" "+I[U])},R=function(){!ne($,Wt)&&te($,Wt)},F=function(){ve(e,$,P,I[Y])},G=function(n){/^(click|focus)$/.test(I[h])&&!I[w]&&n(e,"blur",I.hide),I[w]&&n(document,rt,W),!Yt&&n(t,ut,I.hide)},J=function(){G(re),fe.call(e,ht,f)},K=function(){G(ce),O(),fe.call(e,vt,f)};this.toggle=function(){null===$?I.show():I.hide()},this.show=function(){clearTimeout(D),D=setTimeout(function(){null===$&&(P=I[X],z(),F(),R(),fe.call(e,dt,f),I[U]?ue($,J):J())},20)},this.hide=function(){clearTimeout(D),D=setTimeout(function(){$&&null!==$&&ne($,Wt)&&(fe.call(e,pt,f),ee($,Wt),I[U]?ue($,K):K())},I[j])},v in e||(I[h]===ct?(re(e,Ft[0],I.show),I[w]||re(e,Ft[1],I.hide)):/^(click|focus)$/.test(I[h])&&re(e,I[h],I.toggle)),e[v]=I}};de(v,Ce,n[Et]("["+o+'="popover"]'));var Ie=function(e,n){e=ae(e);var i=ae(e[Tt](T)),o=e[Tt]("data-offset");if(n=n||{},n[q]||i){for(var a,l=n[q]&&ae(n[q])||i,r=l&&l[It]("A"),c=parseInt(o||n.offset)||10,s=[],u=[],f=e[tt]<e[it]?e:t,d=f===t,h=0,p=r[St];h<p;h++){var v=r[h][Tt]("href"),g=v&&he.test(v)&&ae(v);g&&(s.push(r[h]),u.push(g))}var b=function(t){var n=s[t][Ht],i=u[t],o=le(n,".dropdown"),l=d&&i[Lt](),r=ne(n,Pt)||!1,f=(d?l[Ut]+a:i[F])-c,h=d?l[Xt]+a-c:u[t+1]?u[t+1][F]-c:e[it],p=a>=f&&h>a;if(!r&&p)"LI"!==n.tagName||ne(n,Pt)||(te(n,Pt),r=!0,o&&!ne(o,Pt)&&te(o,Pt),fe.call(e,"activate","scrollspy",s[t]));else if(p){if(!p&&!r||r&&p)return}else"LI"===n.tagName&&ne(n,Pt)&&(ee(n,Pt),r=!1,o&&ne(o,Pt)&&!oe(n[Ht],Pt).length&&ee(o,Pt))},w=function(){a=d?pe().y:e[K];for(var t=0,n=s[St];t<n;t++)b(t)};this.refresh=function(){w()},m in e||(re(f,ft,this.refresh),!Yt&&re(t,ut,this.refresh)),this.refresh(),e[m]=this}};de(m,Ie,n[Et]("["+l+'="scroll"]'));var Ae=function(t,e){t=ae(t);var n=t[Tt](C),i="tab",a="height",l="float",r="isAnimating";e=e||{},this[a]=!!Vt&&(e[a]||"true"===n);var c,s,u,f,d,h,p,v=this,m=le(t,".nav"),b=!1,w=m&&ae(".dropdown",m),y=function(){b[Dt][a]="",ee(b,jt),m[r]=!1},T=function(){b?h?y():setTimeout(function(){b[Dt][a]=p+"px",b[_],ue(b,y)},1):m[r]=!1,fe.call(c,ht,i,s)},x=function(){b&&(u[Dt][l]=zt,f[Dt][l]=zt,d=u[it]),te(f,Pt),fe.call(c,dt,i,s),ee(u,Pt),fe.call(s,vt,i,c),b&&(p=f[it],h=p===d,te(b,jt),b[Dt][a]=d+"px",b[tt],u[Dt][l]="",f[Dt][l]=""),ne(f,"fade")?setTimeout(function(){te(f,Wt),ue(f,T)},20):T()};if(m){m[r]=!1;var I=function(){var t,e=oe(m,Pt);return 1!==e[St]||ne(e[0],"dropdown")?e[St]>1&&(t=e[e[St]-1]):t=e[0],t[It]("A")[0]},A=function(){return ae(I()[Tt]("href"))},L=function(t){t[At](),c=t[q][Tt](o)===i||he.test(t[q][Tt]("href"))?t[q]:t[q][Ht],!m[r]&&!ne(c[Ht],Pt)&&v.show()};this.show=function(){c=c||t,f=ae(c[Tt]("href")),s=I(),u=A(),m[r]=!0,ee(s[Ht],Pt),te(c[Ht],Pt),w&&(ne(t[Ht][Ht],"dropdown-menu")?ne(w,Pt)||te(w,Pt):ne(w,Pt)&&ee(w,Pt)),fe.call(s,pt,i,c),ne(u,"fade")?(ee(u,Wt),ue(u,x)):x()},g in t||re(t,rt,L),this[a]&&(b=A()[Ht]),t[g]=this}};de(g,Ae,n[Et]("["+o+'="tab"]'));var Le=function(e,o){e=ae(e);var a=e[Tt](H),l=e[Tt](N),r=e[Tt](B),c=e[Tt](S),s="tooltip",u="class",f="title",d="fade",h="div",p=le(e,".modal"),v=le(e,"."+Kt),m=le(e,"."+Qt);o=o||{},this[U]=o[U]&&o[U]!==d?o[U]:a||d,this[X]=o[X]?o[X]:l||Ut,this[j]=parseInt(o[j]||r)||200,this[Y]=ae(o[Y])?ae(o[Y]):ae(c)?ae(c):v?v:m?m:p?p:n[i];var g=this,w=0,y=this[X],T=null,x=e[Tt](f)||e[Tt](A)||e[Tt](L);if(x&&""!=x){var C=function(){g[Y].removeChild(T),T=null,w=null},I=function(){if(x=e[Tt](f)||e[Tt](A)||e[Tt](L),!x||""==x)return!1;T=document.createElement(h),T[xt]("role",s);var t=document.createElement(h),n=document.createElement(h);t[xt](u,s+"-arrow"),n[xt](u,s+"-inner"),T.appendChild(t),T.appendChild(n),n.innerHTML=x,g[Y].appendChild(T),T[xt](u,s+" "+y+" "+g[U])},E=function(){ve(e,T,y,g[Y])},k=function(){!ne(T,Wt)&&te(T,Wt)},M=function(){fe.call(e,ht,s),!Yt&&re(t,ut,g.hide)},$=function(){!Yt&&ce(t,ut,g.hide),C(),fe.call(e,vt,s)};this.show=function(){clearTimeout(w),w=setTimeout(function(){if(null===T){if(y=g[X],0==I())return;E(),k(),fe.call(e,dt,s),g[U]?ue(T,M):M()}},20)},this.hide=function(){clearTimeout(w),w=setTimeout(function(){T&&null!==T&&ne(T,Wt)&&(fe.call(e,pt,s),ee(T,Wt),g[U]?ue(T,$):$())},g[j])},this.toggle=function(){T?g.hide():g.show()},b in e||(e[xt](L,x),e.removeAttribute(f),re(e,Ft[0],g.show),re(e,Ft[1],g.hide)),e[b]=this}};return de(b,Le,n[Et]("["+o+'="tooltip"]')),{Affix:me,Alert:ge,Button:be,Carousel:we,Collapse:ye,Dropdown:Te,Modal:xe,Popover:Ce,ScrollSpy:Ie,Tab:Ae,Tooltip:Le}}); |
@@ -60,3 +60,3 @@ | ||
indicatorHandler = function(e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
if (isSliding) return; | ||
@@ -73,3 +73,3 @@ | ||
controlsHandler = function (e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
if (isSliding) return; | ||
@@ -101,2 +101,7 @@ | ||
// private methods | ||
isElementInScrollRange = function () { | ||
var rect = element[getBoundingClientRect](), | ||
viewportHeight = globalObject[innerHeight] || HTML[clientHeight] | ||
return rect[top] <= viewportHeight && rect[bottom] >= 0; // bottom && top | ||
}, | ||
setActivePage = function( pageIndex ) { //indicators | ||
@@ -113,4 +118,3 @@ for ( var i = 0, icl = indicators[length]; i < icl; i++ ) { | ||
timer = setInterval(function() { | ||
index++; | ||
self.slideTo( index ); | ||
isElementInScrollRange() && (index++, self.slideTo( index ) ); | ||
}, this[interval]); | ||
@@ -117,0 +121,0 @@ }; |
@@ -71,3 +71,3 @@ | ||
this.toggle = function(e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
if ( isAnimating ) return; | ||
@@ -74,0 +74,0 @@ if (!hasClass(collapse,inClass)) { self.show(); } |
@@ -162,3 +162,3 @@ | ||
self.show(); | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
} | ||
@@ -178,3 +178,3 @@ }, | ||
self.hide(); relatedTarget = null; | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
} | ||
@@ -181,0 +181,0 @@ }; |
@@ -116,6 +116,2 @@ | ||
styleTip(element,popover,placementSetting,self[container]); | ||
if (!isElementInViewport(popover) ) { | ||
placementSetting = updatePlacement(placementSetting); | ||
styleTip(element,popover,placementSetting,self[container]); | ||
} | ||
}, | ||
@@ -122,0 +118,0 @@ |
@@ -39,4 +39,4 @@ | ||
triggerEnd(); | ||
} else { | ||
setTimeout(function(){ | ||
} else { | ||
setTimeout(function(){ // enables height animation | ||
tabsContentContainer[style][height] = nextHeight + 'px'; // height animation | ||
@@ -54,4 +54,4 @@ tabsContentContainer[offsetWidth]; | ||
if (tabsContentContainer) { | ||
activeContent[style][float] = 'left'; | ||
nextContent[style][float] = 'left'; | ||
activeContent[style][float] = left; | ||
nextContent[style][float] = left; | ||
containerHeight = activeContent[scrollHeight]; | ||
@@ -75,5 +75,8 @@ } | ||
} | ||
if ( hasClass(nextContent, 'fade') ) { | ||
addClass(nextContent,inClass); | ||
emulateTransitionEnd(nextContent,triggerShow); | ||
setTimeout(function(){ // makes sure to go forward | ||
addClass(nextContent,inClass); | ||
emulateTransitionEnd(nextContent,triggerShow); | ||
},20); | ||
} else { triggerShow(); } | ||
@@ -102,3 +105,3 @@ }; | ||
clickHandler = function(e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
next = e[target][getAttribute](dataToggle) === component || targetsReg.test(e[target][getAttribute]('href')) | ||
@@ -105,0 +108,0 @@ ? e[target] : e[target][parentNode]; // allow for child elements like icons to use the handler |
@@ -73,6 +73,2 @@ | ||
styleTip(element,tooltip,placementSetting,self[container]); | ||
if (!isElementInViewport(tooltip) ) { | ||
placementSetting = updatePlacement(placementSetting); | ||
styleTip(element,tooltip,placementSetting,self[container]); | ||
} | ||
}, | ||
@@ -126,4 +122,4 @@ showTooltip = function () { | ||
element.removeAttribute(title); | ||
on(element, mouseHover[0], this.show); | ||
on(element, mouseHover[1], this.hide); | ||
on(element, mouseHover[0], self.show); | ||
on(element, mouseHover[1], self.hide); | ||
} | ||
@@ -130,0 +126,0 @@ element[stringTooltip] = this; |
@@ -116,9 +116,9 @@ | ||
// tooltip / popover | ||
fixedTop = 'navbar-fixed-top', | ||
fixedBottom = 'navbar-fixed-bottom', | ||
mouseHover = ('onmouseleave' in document) ? [ 'mouseenter', 'mouseleave'] : [ 'mouseover', 'mouseout' ], | ||
tipPositions = /\b(top|bottom|left|top)+/, | ||
tipPositions = /\b(top|bottom|left|right)+/, | ||
// modal | ||
modalOverlay = 0, | ||
fixedTop = 'navbar-fixed-top', | ||
fixedBottom = 'navbar-fixed-bottom', | ||
@@ -205,8 +205,2 @@ // transitionEnd since 2.0.4 | ||
// tooltip / popover stuff | ||
isElementInViewport = function(element) { // check if this.tooltip is in viewport | ||
var rect = element[getBoundingClientRect](); | ||
return ( rect[top] >= 0 && rect[left] >= 0 && | ||
rect[bottom] <= (globalObject[innerHeight] || HTML[clientHeight]) && | ||
rect[right] <= (globalObject[innerWidth] || HTML[clientWidth]) ) | ||
}, | ||
getScroll = function() { // also Affix and ScrollSpy uses it | ||
@@ -218,33 +212,72 @@ return { | ||
}, | ||
styleTip = function(link,element,position,parent) { // both popovers and tooltips | ||
var rect = link[getBoundingClientRect](), | ||
styleTip = function(link,element,position,parent) { // both popovers and tooltips (target,tooltip/popover,placement,elementToAppendTo) | ||
var elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] }, | ||
windowWidth = (HTML[clientWidth] || DOC[body][clientWidth]), | ||
windowHeight = (HTML[clientHeight] || DOC[body][clientHeight]), | ||
rect = link[getBoundingClientRect](), | ||
scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] }, | ||
linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] }, | ||
elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] }; | ||
arrow = queryElement('[class*="arrow"]',element), | ||
topPosition, leftPosition, arrowTop, arrowLeft, | ||
halfTopExceed = rect[top] + linkDimensions.h/2 - elementDimensions.h/2 < 0, | ||
halfLeftExceed = rect[left] + linkDimensions.w/2 - elementDimensions.w/2 < 0, | ||
halfRightExceed = rect[left] + elementDimensions.w/2 + linkDimensions.w/2 >= windowWidth, | ||
halfBottomExceed = rect[top] + elementDimensions.h/2 + linkDimensions.h/2 >= windowHeight, | ||
topExceed = rect[top] - elementDimensions.h < 0, | ||
leftExceed = rect[left] - elementDimensions.w < 0, | ||
bottomExceed = rect[top] + elementDimensions.h + linkDimensions.h >= windowHeight, | ||
rightExceed = rect[left] + elementDimensions.w + linkDimensions.w >= windowWidth; | ||
// recompute position | ||
position = (position === left || position === right) && leftExceed && rightExceed ? top : position; // first, when both left and right limits are exceeded, we fall back to top|bottom | ||
position = position === top && topExceed ? bottom : position; | ||
position = position === bottom && bottomExceed ? top : position; | ||
position = position === left && leftExceed ? right : position; | ||
position = position === right && rightExceed ? left : position; | ||
// apply styling to tooltip or popover | ||
if ( position === top ) { // TOP | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
if ( position === left || position === right ) { // secondary|side positions | ||
if ( position === left ) { // LEFT | ||
leftPosition = rect[left] + scroll.x - elementDimensions.w; | ||
} else if ( position === right ) { // RIGHT | ||
leftPosition = rect[left] + scroll.x + linkDimensions.w; | ||
} | ||
} else if ( position === bottom ) { // BOTTOM | ||
element[style][top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
// adjust top and arrow | ||
if (halfTopExceed) { | ||
topPosition = rect[top] + scroll.y; | ||
arrowTop = linkDimensions.h/2; | ||
} else if (halfBottomExceed) { | ||
topPosition = rect[top] + scroll.y - elementDimensions.h + linkDimensions.h; | ||
arrowTop = elementDimensions.h - linkDimensions.h/2; | ||
} else { | ||
topPosition = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2; | ||
} | ||
} else if ( position === top || position === bottom ) { // primary|vertical positions | ||
if ( position === top) { // TOP | ||
topPosition = rect[top] + scroll.y - elementDimensions.h; | ||
} else if ( position === bottom ) { // BOTTOM | ||
topPosition = rect[top] + scroll.y + linkDimensions.h; | ||
} | ||
// adjust left | right and also the arrow | ||
if (halfLeftExceed) { | ||
leftPosition = 0; | ||
arrowLeft = rect[left] + linkDimensions.w/2; | ||
} else if (halfRightExceed) { | ||
leftPosition = windowWidth - elementDimensions.w*1.01; | ||
arrowLeft = elementDimensions.w - ( windowWidth - rect[left] ) + linkDimensions.w/2; | ||
} else { | ||
leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2; | ||
} | ||
} | ||
} else if ( position === left ) { // LEFT | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w + 'px'; | ||
// apply style to tooltip/popover and it's arrow | ||
element[style][top] = topPosition + 'px'; | ||
element[style][left] = leftPosition + 'px'; | ||
} else if ( position === right ) { // RIGHT | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
} | ||
arrowTop && (arrow[style][top] = arrowTop + 'px'); | ||
arrowLeft && (arrow[style][left] = arrowLeft + 'px'); | ||
element.className[indexOf](position) === -1 && (element.className = element.className.replace(tipPositions,position)); | ||
}, | ||
updatePlacement = function(position) { | ||
return position === top ? bottom : // top | ||
position === bottom ? top : // bottom | ||
position === left ? right : // left | ||
position === right ? left : position; // right | ||
}; | ||
@@ -61,3 +61,3 @@ | ||
indicatorHandler = function(e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
if (isSliding) return; | ||
@@ -74,3 +74,3 @@ | ||
controlsHandler = function (e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
if (isSliding) return; | ||
@@ -102,2 +102,7 @@ | ||
// private methods | ||
isElementInScrollRange = function () { | ||
var rect = element[getBoundingClientRect](), | ||
viewportHeight = globalObject[innerHeight] || HTML[clientHeight] | ||
return rect[top] <= viewportHeight && rect[bottom] >= 0; // bottom && top | ||
}, | ||
setActivePage = function( pageIndex ) { //indicators | ||
@@ -114,5 +119,3 @@ for ( var i = 0, icl = indicators[length]; i < icl; i++ ) { | ||
timer = setInterval(function() { | ||
index++; | ||
self.slideTo( index ); | ||
isElementInScrollRange() && (index++, self.slideTo( index ) ); | ||
}, this[interval]); | ||
@@ -119,0 +122,0 @@ }; |
@@ -71,3 +71,3 @@ | ||
this.toggle = function(e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
if (isAnimating) return; | ||
@@ -74,0 +74,0 @@ if (!hasClass(collapse,showClass)) { self.show(); } |
@@ -162,3 +162,3 @@ | ||
self.show(); | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
} | ||
@@ -177,3 +177,3 @@ }, | ||
self.hide(); relatedTarget = null; | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
} | ||
@@ -180,0 +180,0 @@ }; |
@@ -120,6 +120,2 @@ | ||
styleTip(element,popover,placementSetting,self[container]); | ||
if (!isElementInViewport(popover) ) { | ||
placementSetting = updatePlacement(placementSetting); | ||
styleTip(element,popover,placementSetting,self[container]); | ||
} | ||
}, | ||
@@ -126,0 +122,0 @@ |
@@ -39,4 +39,4 @@ | ||
triggerEnd(); | ||
} else { | ||
setTimeout(function(){ | ||
} else { | ||
setTimeout(function(){ // enables height animation | ||
tabsContentContainer[style][height] = nextHeight + 'px'; // height animation | ||
@@ -54,4 +54,4 @@ tabsContentContainer[offsetWidth]; | ||
if (tabsContentContainer) { | ||
activeContent[style][float] = 'left'; | ||
nextContent[style][float] = 'left'; | ||
activeContent[style][float] = left; | ||
nextContent[style][float] = left; | ||
containerHeight = activeContent[scrollHeight]; | ||
@@ -75,5 +75,8 @@ } | ||
} | ||
if ( hasClass(nextContent, 'fade') ) { | ||
addClass(nextContent,showClass); | ||
emulateTransitionEnd(nextContent,triggerShow); | ||
setTimeout(function(){ | ||
addClass(nextContent,showClass); | ||
emulateTransitionEnd(nextContent,triggerShow); | ||
},20); | ||
} else { triggerShow(); } | ||
@@ -102,3 +105,3 @@ }; | ||
clickHandler = function(e) { | ||
e.preventDefault(); | ||
e[preventDefault](); | ||
next = e[target][getAttribute](dataToggle) === component || targetsReg.test(e[target][getAttribute]('href')) | ||
@@ -105,0 +108,0 @@ ? e[target] : e[target][parentNode]; // allow for child elements like icons to use the handler |
@@ -75,6 +75,2 @@ | ||
styleTip(element,tooltip,placementSetting,self[container]); | ||
if (!isElementInViewport(tooltip) ) { | ||
placementSetting = updatePlacement(placementSetting); | ||
styleTip(element,tooltip,placementSetting,self[container]); | ||
} | ||
}, | ||
@@ -81,0 +77,0 @@ showTooltip = function () { |
@@ -88,2 +88,3 @@ | ||
getElementsByTagName = 'getElementsByTagName', | ||
preventDefault = 'preventDefault', | ||
getBoundingClientRect = 'getBoundingClientRect', | ||
@@ -95,3 +96,2 @@ querySelectorAll = 'querySelectorAll', | ||
parentNode = 'parentNode', | ||
preventDefault = 'preventDefault', | ||
length = 'length', | ||
@@ -114,9 +114,9 @@ toLowerCase = 'toLowerCase', | ||
// tooltip / popover | ||
fixedTop = 'fixed-top', | ||
fixedBottom = 'fixed-bottom', | ||
mouseHover = ('onmouseleave' in document) ? [ 'mouseenter', 'mouseleave'] : [ 'mouseover', 'mouseout' ], | ||
tipPositions = /\b(top|bottom|left|top)+/, | ||
tipPositions = /\b(top|bottom|left|right)+/, | ||
// modal | ||
modalOverlay = 0, | ||
fixedTop = 'fixed-top', | ||
fixedBottom = 'fixed-bottom', | ||
@@ -198,8 +198,2 @@ // transitionEnd since 2.0.4 | ||
// tooltip / popover stuff | ||
isElementInViewport = function(element) { // check if this.tooltip is in viewport | ||
var rect = element[getBoundingClientRect](); | ||
return ( rect[top] >= 0 && rect[left] >= 0 && | ||
rect[bottom] <= (globalObject[innerHeight] || HTML[clientHeight]) && | ||
rect[right] <= (globalObject[innerWidth] || HTML[clientWidth]) ) | ||
}, | ||
getScroll = function() { // also Affix and ScrollSpy uses it | ||
@@ -211,38 +205,79 @@ return { | ||
}, | ||
styleTip = function(link,element,position,parent) { // both popovers and tooltips | ||
var rect = link[getBoundingClientRect](), | ||
styleTip = function(link,element,position,parent) { // both popovers and tooltips (target,tooltip,placement,elementToAppendTo) | ||
var elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] }, | ||
windowWidth = (HTML[clientWidth] || DOC[body][clientWidth]), | ||
windowHeight = (HTML[clientHeight] || DOC[body][clientHeight]), | ||
rect = link[getBoundingClientRect](), | ||
scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] }, | ||
linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] }, | ||
arrow = queryElement('.arrow',element), | ||
arrowWidth = arrow[offsetWidth], isPopover = hasClass(element,'popover'), | ||
scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] }, | ||
linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] }, | ||
elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] }; | ||
topPosition, leftPosition, arrowTop, arrowLeft, | ||
halfTopExceed = rect[top] + linkDimensions.h/2 - elementDimensions.h/2 < 0, | ||
halfLeftExceed = rect[left] + linkDimensions.w/2 - elementDimensions.w/2 < 0, | ||
halfRightExceed = rect[left] + elementDimensions.w/2 + linkDimensions.w/2 >= windowWidth, | ||
halfBottomExceed = rect[top] + elementDimensions.h/2 + linkDimensions.h/2 >= windowHeight, | ||
topExceed = rect[top] - elementDimensions.h < 0, | ||
leftExceed = rect[left] - elementDimensions.w < 0, | ||
bottomExceed = rect[top] + elementDimensions.h + linkDimensions.h >= windowHeight, | ||
rightExceed = rect[left] + elementDimensions.w + linkDimensions.w >= windowWidth; | ||
// recompute position | ||
position = (position === left || position === right) && leftExceed && rightExceed ? top : position; // first, when both left and right limits are exceeded, we fall back to top|bottom | ||
position = position === top && topExceed ? bottom : position; | ||
position = position === bottom && bottomExceed ? top : position; | ||
position = position === left && leftExceed ? right : position; | ||
position = position === right && rightExceed ? left : position; | ||
// apply styling to tooltip or popover | ||
if ( position === top ) { // TOP | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h - ( isPopover ? arrowWidth : 0 ) + 'px'; // isPopover is trying to fix bug with V4beta CSS | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
arrow[style][left] = elementDimensions.w/2 - arrowWidth/2 + 'px'; | ||
if ( position === left || position === right ) { // secondary|side positions | ||
if ( position === left ) { // LEFT | ||
leftPosition = rect[left] + scroll.x - elementDimensions.w; | ||
} else if ( position === right ) { // RIGHT | ||
leftPosition = rect[left] + scroll.x + linkDimensions.w; | ||
} | ||
} else if ( position === bottom ) { // BOTTOM | ||
element[style][top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
arrow[style][left] = elementDimensions.w/2 - arrowWidth/2 + 'px'; | ||
// adjust top and arrow | ||
if (halfTopExceed) { | ||
topPosition = rect[top] + scroll.y; | ||
arrowTop = linkDimensions.h/2 - arrowWidth/2; | ||
} else if (halfBottomExceed) { | ||
topPosition = rect[top] + scroll.y - elementDimensions.h + linkDimensions.h; | ||
arrowTop = elementDimensions.h - linkDimensions.h/2 - arrowWidth/2; | ||
} else { | ||
topPosition = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2; | ||
arrowTop = elementDimensions.h/2 - arrowWidth/2; | ||
} | ||
} else if ( position === top || position === bottom ) { // primary|vertical positions | ||
if ( position === top) { // TOP | ||
topPosition = rect[top] + scroll.y - elementDimensions.h; | ||
} else if ( position === bottom ) { // BOTTOM | ||
topPosition = rect[top] + scroll.y + linkDimensions.h; | ||
} | ||
// adjust left | right and also the arrow | ||
if (halfLeftExceed) { | ||
leftPosition = 0; | ||
arrowLeft = rect[left] + linkDimensions.w/2 - arrowWidth/2; | ||
} else if (halfRightExceed) { | ||
leftPosition = windowWidth - elementDimensions.w*1.01; | ||
arrowLeft = elementDimensions.w - ( windowWidth - rect[left] ) + linkDimensions.w/2 - arrowWidth/2; | ||
} else { | ||
leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2; | ||
arrowLeft = elementDimensions.w/2 - arrowWidth/2; | ||
} | ||
} | ||
} else if ( position === left ) { // LEFT | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w - ( isPopover ? arrowWidth : 0 ) + 'px'; // isPopover is trying to fix bug with V4beta CSS | ||
arrow[style][top] = elementDimensions.h/2 - arrowWidth/2 + 'px'; | ||
// fixing some CSS bug with Bootstrap 4 alpha | ||
topPosition = position === top && isPopover ? topPosition - arrowWidth : topPosition; | ||
leftPosition = position === left && isPopover ? leftPosition - arrowWidth : leftPosition; | ||
} else if ( position === right ) { // RIGHT | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
arrow[style][top] = elementDimensions.h/2 - arrowWidth/2 + 'px'; | ||
} | ||
// apply style to tooltip/popover and it's arrow | ||
element[style][top] = topPosition + 'px'; | ||
element[style][left] = leftPosition + 'px'; | ||
arrowTop && (arrow[style][top] = arrowTop + 'px'); | ||
arrowLeft && (arrow[style][left] = arrowLeft + 'px'); | ||
element.className[indexOf](position) === -1 && (element.className = element.className.replace(tipPositions,position)); | ||
}, | ||
updatePlacement = function(position) { | ||
return position === top ? bottom : // top | ||
position === bottom ? top : // bottom | ||
position === left ? right : // left | ||
position === right ? left : position; // right | ||
}; |
{ | ||
"name": "bootstrap.native", | ||
"version": "2.0.18", | ||
"version": "2.0.19", | ||
"description": "Native Javascript for Bootstrap, the sweetest Javascript library without jQuery.", | ||
@@ -5,0 +5,0 @@ "main": "dist/bootstrap-native.js", |
@@ -12,3 +12,3 @@ # Native JavaScript for Bootstrap | ||
# Wiki | ||
Please take a minute to check the `bootstrap.native` Wiki pages: | ||
Please take a minute to check the `bootstrap.native` Wiki pages, they're updated with every new commit: | ||
* [Acknowledgements](https://github.com/thednp/bootstrap.native/wiki/Acknowledgements) - A quick note on some of the similarities and differences with the original jQuery plugins. Nothing to worry about, but still good to know all the tricks on how to maximize your workflow. | ||
@@ -15,0 +15,0 @@ * [How to use](https://github.com/thednp/bootstrap.native/wiki/How-to-use) - An in depth guide on how to use it with stuff like `npm`, `RequireJS` or `CDN` links. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
392091
8081