diff --git a/dist/bootstrap-native-v4.js b/dist/bootstrap-native-v4.js index 3aec6964..be579e0a 100644 --- a/dist/bootstrap-native-v4.js +++ b/dist/bootstrap-native-v4.js @@ -1,4 +1,4 @@ -// Native Javascript for Bootstrap 4 v2.0.26 | © dnp_theme | MIT-License +// Native Javascript for Bootstrap 4 v2.0.27 | © dnp_theme | MIT-License (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD support: @@ -319,7 +319,7 @@ arrowLeft && (arrow[style][left] = arrowLeft + 'px'); }; - BSN.version = '2.0.26'; + BSN.version = '2.0.27'; /* Native Javascript for Bootstrap 4 | Alert -------------------------------------------*/ @@ -1020,8 +1020,8 @@ // determine modal, triggering element btnCheck = element[getAttribute](dataTarget)||element[getAttribute]('href'), checkModal = queryElement( btnCheck ), - modal = hasClass(element,component) ? element : checkModal; - + modal = hasClass(element,component) ? element : checkModal; + if ( hasClass(element, component) ) { element = null; } // modal is now independent of it's triggering element if ( !modal ) { return; } // invalidate @@ -1032,6 +1032,7 @@ this[keyboard] = options[keyboard] === false || modal[getAttribute](dataKeyboard) === 'false' ? false : true; this[backdrop] = options[backdrop] === staticString || modal[getAttribute](databackdrop) === staticString ? staticString : true; this[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : this[backdrop]; + this[animation] = hasClass(modal, 'fade') ? true : false; this[content] = options[content]; // JavaScript only // bind, constants, event targets and other vars @@ -1082,13 +1083,13 @@ scrollBarWidth = measureScrollbar(); }, createOverlay = function() { - modalOverlay = 1; - + modalOverlay = 1; + var newOverlay = DOC[createElement]('div'); overlay = queryElement('.'+modalBackdropString); if ( overlay === null ) { - newOverlay[setAttribute]('class',modalBackdropString+' fade'); + newOverlay[setAttribute]('class', modalBackdropString + (self[animation] ? ' fade' : '')); overlay = newOverlay; DOC[body][appendChild](overlay); } @@ -1096,10 +1097,10 @@ removeOverlay = function() { overlay = queryElement('.'+modalBackdropString); if ( overlay && overlay !== null && typeof overlay === 'object' ) { - modalOverlay = 0; + modalOverlay = 0; DOC[body].removeChild(overlay); overlay = null; } - bootstrapCustomEvent.call(modal, hiddenEvent, component); + bootstrapCustomEvent.call(modal, hiddenEvent, component); }, keydownHandlerToggle = function() { if (hasClass(modal,showClass)) { @@ -1133,12 +1134,12 @@ triggerHide = function() { modal[style].display = ''; element && (setFocus(element)); - + (function(){ if (!getElementsByClassName(DOC,component+' '+showClass)[0]) { resetScrollbar(); removeClass(DOC[body],component+'-open'); - overlay && hasClass(overlay,'fade') ? (removeClass(overlay,showClass), emulateTransitionEnd(overlay,removeOverlay)) + overlay && hasClass(overlay,'fade') ? (removeClass(overlay,showClass), emulateTransitionEnd(overlay,removeOverlay)) : removeOverlay(); resizeHandlerToggle(); @@ -1193,7 +1194,7 @@ if ( overlay && modalOverlay && !hasClass(overlay,showClass)) { overlay[offsetWidth]; // force reflow to enable trasition - overlayDelay = getTransitionDurationFromElement(overlay); + overlayDelay = getTransitionDurationFromElement(overlay); addClass(overlay, showClass); } @@ -1213,7 +1214,7 @@ this.hide = function() { bootstrapCustomEvent.call(modal, hideEvent, component); overlay = queryElement('.'+modalBackdropString); - overlayDelay = overlay && getTransitionDurationFromElement(overlay); + overlayDelay = overlay && getTransitionDurationFromElement(overlay); removeClass(modal,showClass); modal[setAttribute](ariaHidden, true); diff --git a/dist/bootstrap-native-v4.min.js b/dist/bootstrap-native-v4.min.js index ef9a719a..785c622e 100644 --- a/dist/bootstrap-native-v4.min.js +++ b/dist/bootstrap-native-v4.min.js @@ -1,2 +1,2 @@ -// Native Javascript for Bootstrap 4 v2.0.26 | © 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 i=e();t.Alert=i.Alert,t.Button=i.Button,t.Carousel=i.Carousel,t.Collapse=i.Collapse,t.Dropdown=i.Dropdown,t.Modal=i.Modal,t.Popover=i.Popover,t.ScrollSpy=i.ScrollSpy,t.Tab=i.Tab,t.Toast=i.Toast,t.Tooltip=i.Tooltip}}(this,function(){"use strict";var t="undefined"!=typeof global?global:this||window,e=document,i=e.documentElement,n="body",o=t.BSN={},a=o.supports=[],l="delay",r="target",s="animation",c="getAttribute",d="setAttribute",u="parentNode",h="length",f="Transition",p="Webkit",g="style",m="push",v="active",w="left",b="top",T="onmouseleave"in e?["mouseenter","mouseleave"]:["mouseover","mouseout"],y=/\b(top|bottom|left|right)+/,k=0,C=p+f in i[g]||f.toLowerCase()in i[g],x=p+f in i[g]?p.toLowerCase()+f+"End":f.toLowerCase()+"end",A=p+"Duration"in i[g]?p.toLowerCase()+f+"Duration":f.toLowerCase()+"Duration",E={start:"touchstart",end:"touchend",move:"touchmove"},L=function(t){t.focus?t.focus():t.setActive()},N=function(t,e){t.classList.add(e)},D=function(t,e){t.classList.remove(e)},I=function(t,e){return t.classList.contains(e)},H=function(t,e){return[].slice.call(t.getElementsByClassName(e))},B=function(t,i){var n=i||e;return"object"==typeof t?t:n.querySelector(t)},M=function(t,i){var n=i.charAt(0),o=i.substr(1);if("."===n){for(;t&&t!==e;t=t[u])if(null!==B(i,t[u])&&I(t,o))return t}else if("#"===n)for(;t&&t!==e;t=t[u])if(t.id===o)return t;return!1},S=function(t,e,i){t.addEventListener(e,i,!1)},W=function(t,e,i){t.removeEventListener(e,i,!1)},R=function(t,e,i){S(t,e,function n(o){i(o),W(t,e,n)})},P=function(e){var i=C?t.getComputedStyle(e)[A]:0;return i=parseFloat(i),i="number"!=typeof i||isNaN(i)?0:1e3*i},z=function(t,e){var i=0;P(t)?R(t,x,function(t){!i&&e(t),i=1}):setTimeout(function(){!i&&e(),i=1},17)},O=function(t,e,i){var n=new CustomEvent(t+".bs."+e);n.relatedTarget=i,this.dispatchEvent(n)},X=function(){return{y:t.pageYOffset||i.scrollTop,x:t.pageXOffset||i.scrollLeft}},j=function(t,o,a,l){var r,s,c,d,u,h,f={w:o.offsetWidth,h:o.offsetHeight},p=i.clientWidth||e[n].clientWidth,m=i.clientHeight||e[n].clientHeight,v=t.getBoundingClientRect(),T=l===e[n]?X():{x:l.offsetLeft+l.scrollLeft,y:l.offsetTop+l.scrollTop},k={w:v.right-v[w],h:v.bottom-v[b]},C=I(o,"popover"),x=B(".arrow",o),A=v[b]+k.h/2-f.h/2<0,E=v[w]+k.w/2-f.w/2<0,L=v[w]+f.w/2+k.w/2>=p,N=v[b]+f.h/2+k.h/2>=m,D=v[b]-f.h<0,H=v[w]-f.w<0,M=v[b]+f.h+k.h>=m,S=v[w]+f.w+k.w>=p;a=(a===w||"right"===a)&&H&&S?b:a,a=a===b&&D?"bottom":a,a="bottom"===a&&M?b:a,a=a===w&&H?"right":a,a="right"===a&&S?w:a,-1===o.className.indexOf(a)&&(o.className=o.className.replace(y,a)),u=x.offsetWidth,h=x.offsetHeight,a===w||"right"===a?(s=a===w?v[w]+T.x-f.w-(C?u:0):v[w]+T.x+k.w,A?(r=v[b]+T.y,c=k.h/2-u):N?(r=v[b]+T.y-f.h+k.h,c=f.h-k.h/2-u):(r=v[b]+T.y-f.h/2+k.h/2,c=f.h/2-(C?.9*h:h/2))):a!==b&&"bottom"!==a||(r=a===b?v[b]+T.y-f.h-(C?h:0):v[b]+T.y+k.h,E?(s=0,d=v[w]+k.w/2-u):L?(s=p-1.01*f.w,d=f.w-(p-v[w])+k.w/2-u/2):(s=v[w]+T.x-f.w/2+k.w/2,d=f.w/2-u/2)),o[g][b]=r+"px",o[g][w]=s+"px",c&&(x[g][b]=c+"px"),d&&(x[g][w]=d+"px")};o.version="2.0.26";var U=function(t){t=B(t);var e=this,i=M(t,".alert"),n=function(){I(i,"fade")?z(i,a):a()},o=function(n){i=M(n[r],".alert"),(t=B('[data-dismiss="alert"]',i))&&i&&(t===n[r]||t.contains(n[r]))&&e.close()},a=function(){O.call(i,"closed","alert"),W(t,"click",o),i[u].removeChild(i)};this.close=function(){i&&t&&I(i,"show")&&(O.call(i,"close","alert"),D(i,"show"),i&&n())},"Alert"in t||S(t,"click",o),t.Alert=e};a[m](["Alert",U,'[data-dismiss="alert"]']);var q=function(t){t=B(t);var i=!1,n="checked",o=function(t){32===(t.which||t.keyCode)&&t[r]===e.activeElement&&l(t)},a=function(t){32===(t.which||t.keyCode)&&t.preventDefault()},l=function(e){var o="LABEL"===e[r].tagName?e[r]:"LABEL"===e[r][u].tagName?e[r][u]:null;if(o){var a=e[r],l=H(a[u],"btn"),s=o.getElementsByTagName("INPUT")[0];if(s){if("checkbox"===s.type&&(s[n]?(D(o,v),s[c](n),s.removeAttribute(n),s[n]=!1):(N(o,v),s[c](n),s[d](n,n),s[n]=!0),i||(i=!0,O.call(s,"change","button"),O.call(t,"change","button"))),"radio"===s.type&&!i&&!s[n]){N(o,v),s[d](n,n),s[n]=!0,O.call(s,"change","button"),O.call(t,"change","button"),i=!0;for(var f=0,p=l[h];f1?(t.preventDefault(),!1):void 0):void t.preventDefault()},Z=function(t){if(y&&!m&&(A=x||parseInt(t.touches[0].pageX),y)){if((!n.contains(t[r])||!n.contains(t.relatedTarget))&&Math.abs(k-A)<75)return!1;xk&&p--,y=!1,f.slideTo(p),K(W)}},$=function(){var e=n.getBoundingClientRect(),o=t.innerHeight||i.clientHeight;return e[b]<=o&&e.bottom>=0},_=function(t){for(var e=0,i=U[h];et||o===M-1&&0===t)&&(R=f.direction="right"),t<0?t=M-1:t>=M&&(t=0),p=t,i=R===w?"next":"prev",O.call(n,"slide","carousel",L[t]),m=!0,clearInterval(g),g=null,_(t),C&&I(n,"slide")?(N(L[t],"carousel-item-"+i),L[t].offsetWidth,N(L[t],"carousel-item-"+R),N(L[o],"carousel-item-"+R),z(L[t],function(a){var l=a&&a[r]!==L[t]?1e3*a.elapsedTime+100:20;m&&setTimeout(function(){m=!1,N(L[t],v),D(L[o],v),D(L[t],"carousel-item-"+i),D(L[t],"carousel-item-"+R),D(L[o],"carousel-item-"+R),O.call(n,"slid","carousel",L[t]),e.hidden||!f.interval||I(n,"paused")||f.cycle()},l)})):(N(L[t],v),L[t].offsetWidth,D(L[o],v),setTimeout(function(){m=!1,f.interval&&!I(n,"paused")&&f.cycle(),O.call(n,"slid","carousel",L[t])},100)))}},this.getActiveIndex=function(){return L.indexOf(H(n,"carousel-item active")[0])||0},"Carousel"in n||(f.pause&&f.interval&&(S(n,T[0],q),S(n,T[1],F),S(n,E.start,q),S(n,E.end,F)),L[h]>1&&S(n,E.start,Q),X&&S(X,"click",G),P&&S(P,"click",G),j&&S(j,"click",Y),!0===f.keyboard&&S(t,"keydown",J)),f.getActiveIndex()<0&&(L[h]&&N(L[0],v),U[h]&&_(0)),f.interval&&f.cycle(),n.Carousel=f}};a[m](["Carousel",F,'[data-ride="carousel"]']);var Y=function(t,e){t=B(t),e=e||{};var i,n,o=null,a=null,l=this,r=t[c]("data-parent"),s=function(t,e){O.call(t,"show","collapse"),t.isAnimating=!0,N(t,"collapsing"),D(t,"collapse"),t[g].height=t.scrollHeight+"px",z(t,function(){t.isAnimating=!1,t[d]("aria-expanded","true"),e[d]("aria-expanded","true"),D(t,"collapsing"),N(t,"collapse"),N(t,"show"),t[g].height="",O.call(t,"shown","collapse")})},u=function(t,e){O.call(t,"hide","collapse"),t.isAnimating=!0,t[g].height=t.scrollHeight+"px",D(t,"collapse"),D(t,"show"),N(t,"collapsing"),t.offsetWidth,t[g].height="0px",z(t,function(){t.isAnimating=!1,t[d]("aria-expanded","false"),e[d]("aria-expanded","false"),D(t,"collapsing"),N(t,"collapse"),t[g].height="",O.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),I(a,"show")?l.hide():l.show()},this.hide=function(){a.isAnimating||(u(a,t),N(t,"collapsed"))},this.show=function(){o&&(i=B(".collapse.show",o),n=i&&(B('[data-target="#'+i.id+'"]',o)||B('[href="#'+i.id+'"]',o))),(!a.isAnimating||i&&!i.isAnimating)&&(n&&i!==a&&(u(i,n),N(n,"collapsed")),s(a,t),D(t,"collapsed"))},"Collapse"in t||S(t,"click",l.toggle),a=function(){var e=t.href&&t[c]("href"),i=t[c]("data-target"),n=e||i&&"#"===i.charAt(0)&&i;return n&&B(n)}(),a.isAnimating=!1,o=B(e.parent)||r&&M(t,r),t.Collapse=l};a[m](["Collapse",Y,'[data-toggle="collapse"]']);var G=function(t,i){t=B(t),this.persist=!0===i||"true"===t[c]("data-persist")||!1;var n=this,o=t[u],a=null,l=B(".dropdown-menu",o),s=function(){for(var t=l.children,e=[],i=0;i1?c-1:0:40===o&&c×',w=B(o.container),y=B(m),k=M(i,".modal"),C=M(i,".fixed-top"),x=M(i,".fixed-bottom");this.template=o.template?o.template:null,this.trigger=o.trigger?o.trigger:a||"hover",this[s]=o[s]&&"fade"!==o[s]?o[s]:u||"fade",this.placement=o.placement?o.placement:h||b,this[l]=parseInt(o[l]||p)||200,this.dismissible=!(!o.dismissible&&"true"!==f),this.container=w||(y||(C||(x||(k||e[n]))));var A=this,E=i[c]("data-title")||null,L=i[c]("data-content")||null;if(L||this.template){var H=null,R=0,P=this.placement,X=function(t){null!==H&&t[r]===B(".close",H)&&A.hide()},U=function(){A.container.removeChild(H),R=null,H=null},q=function(){E=o.title||i[c]("data-title")||null,L=o.content||i[c]("data-content")||null,H=e.createElement("div");var t=e.createElement("div");if(t[d]("class","arrow"),H.appendChild(t),null!==L&&null===A.template){if(H[d]("role","tooltip"),null!==E){var n=e.createElement("h3");n[d]("class","popover-header"),n.innerHTML=A.dismissible?E+v:E,H.appendChild(n)}var a=e.createElement("div");a[d]("class","popover-body"),a.innerHTML=A.dismissible&&null===E?L+v:L,H.appendChild(a)}else{var l=e.createElement("div");l.innerHTML=A.template,H.innerHTML=l.firstChild.innerHTML}A.container.appendChild(H),H[g].display="block",H[d]("class","popover bs-popover-"+P+" "+A[s])},F=function(){!I(H,"show")&&N(H,"show")},Y=function(){j(i,H,P,A.container)},G=function(n){"click"!=A.trigger&&"focus"!=A.trigger||!A.dismissible&&n(i,"blur",A.hide),A.dismissible&&n(e,"click",X),n(t,"resize",A.hide)},J=function(){G(S),O.call(i,"shown","popover")},K=function(){G(W),U(),O.call(i,"hidden","popover")};this.toggle=function(){null===H?A.show():A.hide()},this.show=function(){clearTimeout(R),R=setTimeout(function(){null===H&&(P=A.placement,q(),Y(),F(),O.call(i,"show","popover"),A[s]?z(H,J):J())},20)},this.hide=function(){clearTimeout(R),R=setTimeout(function(){H&&null!==H&&I(H,"show")&&(O.call(i,"hide","popover"),D(H,"show"),A[s]?z(H,K):K())},A[l])},"Popover"in i||("hover"===A.trigger?(S(i,T[0],A.show),A.dismissible||S(i,T[1],A.hide)):"click"!=A.trigger&&"focus"!=A.trigger||S(i,A.trigger,A.toggle)),i.Popover=A}};a[m](["Popover",K,'[data-toggle="popover"]']);var Q=function(e,i){e=B(e);var n=B(e[c]("data-target")),o=e[c]("data-offset");if(i=i||{},i[r]||n){for(var a,l=this,s=i[r]&&B(i[r])||n,d=s&&s.getElementsByTagName("A"),f=parseInt(i.offset||o)||10,p=[],g=[],w=e.offsetHeight=c&&d>a;if(!s&&h)I(i,v)||(N(i,v),l&&!I(l,v)&&N(l,v),O.call(e,"activate","scrollspy",p[t]));else if(h){if(!h&&!s||s&&h)return}else I(i,v)&&(D(i,v),l&&I(l,v)&&!H(i[u],v).length&&D(l,v))},E=function(){a=T?X().y:e.scrollTop;for(var t=0,i=p[h];t1&&(t=e[e[h]-1]):t=e[0],t},E=function(){return B(A()[c]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget,!m.isAnimating&&!I(n,v)&&p.show()};this.show=function(){n=n||t,l=B(n[c]("href")),o=A(),a=E(),m.isAnimating=!0,D(o,v),o[d]("aria-selected","false"),N(n,v),n[d]("aria-selected","true"),T&&(I(t[u],"dropdown-menu")?I(T,v)||N(T,v):I(T,v)&&D(T,v)),O.call(o,"hide","tab",n),I(a,"fade")?(D(a,"show"),z(a,x)):x()},"Tab"in t||S(t,"click",L),p.height&&(b=E()[u]),t.Tab=p}};a[m](["Tab",V,'[data-toggle="tab"]']);var Z=function(t,e){t=B(t),e=e||{};var i=t[c]("data-animation"),n=t[c]("data-autohide"),o=t[c]("data-delay");this.animation=!1===e.animation||"false"===i?0:1,this.autohide=!1===e.autohide||"false"===n?0:1,this[l]=parseInt(e[l]||o)||500;var a=this,r=0,s=M(t,".toast"),d=function(){D(s,"showing"),N(s,"show"),O.call(s,"shown","toast"),a.autohide&&a.hide()},u=function(){N(s,"hide"),O.call(s,"hidden","toast")},h=function(){D(s,"show"),a.animation?z(s,u):u()},f=function(){clearTimeout(r),r=null,N(s,"hide"),W(t,"click",a.hide),t.Toast=null,t=null,s=null};this.show=function(){s&&(O.call(s,"show","toast"),a.animation&&N(s,"fade"),D(s,"hide"),N(s,"showing"),a.animation?z(s,d):d())},this.hide=function(t){s&&I(s,"show")&&(O.call(s,"hide","toast"),t?h():r=setTimeout(h,a[l]))},this.dispose=function(){s&&I(s,"show")&&(D(s,"show"),a.animation?z(s,f):f())},"Toast"in t||S(t,"click",a.hide),t.Toast=a};a[m](["Toast",Z,'[data-dismiss="toast"]']);var $=function(i,o){i=B(i),o=o||{};var a=i[c]("data-animation"),r=i[c]("data-placement"),u=i[c]("data-delay"),h=i[c]("data-container"),f=B(o.container),p=B(h),g=M(i,".modal"),m=M(i,".fixed-top"),v=M(i,".fixed-bottom");this[s]=o[s]&&"fade"!==o[s]?o[s]:a||"fade",this.placement=o.placement?o.placement:r||b,this[l]=parseInt(o[l]||u)||200,this.container=f||(p||(m||(v||(g||e[n]))));var w=this,y=0,k=this.placement,C=null,x=i[c]("title")||i[c]("data-title")||i[c]("data-original-title");if(x&&""!=x){var A=function(){w.container.removeChild(C),C=null,y=null},E=function(){if(!(x=i[c]("title")||i[c]("data-title")||i[c]("data-original-title"))||""==x)return!1;C=e.createElement("div"),C[d]("role","tooltip");var t=e.createElement("div");t[d]("class","arrow"),C.appendChild(t);var n=e.createElement("div");n[d]("class","tooltip-inner"),C.appendChild(n),n.innerHTML=x,w.container.appendChild(C),C[d]("class","tooltip bs-tooltip-"+k+" "+w[s])},L=function(){j(i,C,k,w.container)},H=function(){!I(C,"show")&&N(C,"show")},R=function(){S(t,"resize",w.hide),O.call(i,"shown","tooltip")},P=function(){W(t,"resize",w.hide),A(),O.call(i,"hidden","tooltip")};this.show=function(){clearTimeout(y),y=setTimeout(function(){if(null===C){if(k=w.placement,0==E())return;L(),H(),O.call(i,"show","tooltip"),w[s]?z(C,R):R()}},20)},this.hide=function(){clearTimeout(y),y=setTimeout(function(){C&&I(C,"show")&&(O.call(i,"hide","tooltip"),D(C,"show"),w[s]?z(C,P):P())},w[l])},this.toggle=function(){C?w.hide():w.show()},"Tooltip"in i||(i[d]("data-original-title",x),i.removeAttribute("title"),S(i,T[0],w.show),S(i,T[1],w.hide)),i.Tooltip=w}};a[m](["Tooltip",$,'[data-toggle="tooltip"]']);var _=function(t,e){for(var i=0,n=e[h];i=p,N=v[b]+f.h/2+k.h/2>=m,D=v[b]-f.h<0,H=v[w]-f.w<0,M=v[b]+f.h+k.h>=m,S=v[w]+f.w+k.w>=p;a=(a===w||"right"===a)&&H&&S?b:a,a=a===b&&D?"bottom":a,a="bottom"===a&&M?b:a,a=a===w&&H?"right":a,a="right"===a&&S?w:a,-1===o.className.indexOf(a)&&(o.className=o.className.replace(y,a)),u=x.offsetWidth,h=x.offsetHeight,a===w||"right"===a?(s=a===w?v[w]+T.x-f.w-(C?u:0):v[w]+T.x+k.w,A?(r=v[b]+T.y,c=k.h/2-u):N?(r=v[b]+T.y-f.h+k.h,c=f.h-k.h/2-u):(r=v[b]+T.y-f.h/2+k.h/2,c=f.h/2-(C?.9*h:h/2))):a!==b&&"bottom"!==a||(r=a===b?v[b]+T.y-f.h-(C?h:0):v[b]+T.y+k.h,E?(s=0,d=v[w]+k.w/2-u):L?(s=p-1.01*f.w,d=f.w-(p-v[w])+k.w/2-u/2):(s=v[w]+T.x-f.w/2+k.w/2,d=f.w/2-u/2)),o[g][b]=r+"px",o[g][w]=s+"px",c&&(x[g][b]=c+"px"),d&&(x[g][w]=d+"px")};o.version="2.0.27";var U=function(t){t=B(t);var e=this,i=M(t,".alert"),n=function(){I(i,"fade")?z(i,a):a()},o=function(n){i=M(n[r],".alert"),(t=B('[data-dismiss="alert"]',i))&&i&&(t===n[r]||t.contains(n[r]))&&e.close()},a=function(){O.call(i,"closed","alert"),W(t,"click",o),i[u].removeChild(i)};this.close=function(){i&&t&&I(i,"show")&&(O.call(i,"close","alert"),D(i,"show"),i&&n())},"Alert"in t||S(t,"click",o),t.Alert=e};a[m](["Alert",U,'[data-dismiss="alert"]']);var q=function(t){t=B(t);var i=!1,n="checked",o=function(t){32===(t.which||t.keyCode)&&t[r]===e.activeElement&&l(t)},a=function(t){32===(t.which||t.keyCode)&&t.preventDefault()},l=function(e){var o="LABEL"===e[r].tagName?e[r]:"LABEL"===e[r][u].tagName?e[r][u]:null;if(o){var a=e[r],l=H(a[u],"btn"),s=o.getElementsByTagName("INPUT")[0];if(s){if("checkbox"===s.type&&(s[n]?(D(o,v),s[c](n),s.removeAttribute(n),s[n]=!1):(N(o,v),s[c](n),s[d](n,n),s[n]=!0),i||(i=!0,O.call(s,"change","button"),O.call(t,"change","button"))),"radio"===s.type&&!i&&!s[n]){N(o,v),s[d](n,n),s[n]=!0,O.call(s,"change","button"),O.call(t,"change","button"),i=!0;for(var f=0,p=l[h];f1?(t.preventDefault(),!1):void 0):void t.preventDefault()},Z=function(t){if(y&&!m&&(A=x||parseInt(t.touches[0].pageX),y)){if((!n.contains(t[r])||!n.contains(t.relatedTarget))&&Math.abs(k-A)<75)return!1;xk&&p--,y=!1,f.slideTo(p),K(W)}},$=function(){var e=n.getBoundingClientRect(),o=t.innerHeight||i.clientHeight;return e[b]<=o&&e.bottom>=0},_=function(t){for(var e=0,i=U[h];et||o===M-1&&0===t)&&(R=f.direction="right"),t<0?t=M-1:t>=M&&(t=0),p=t,i=R===w?"next":"prev",O.call(n,"slide","carousel",L[t]),m=!0,clearInterval(g),g=null,_(t),C&&I(n,"slide")?(N(L[t],"carousel-item-"+i),L[t].offsetWidth,N(L[t],"carousel-item-"+R),N(L[o],"carousel-item-"+R),z(L[t],function(a){var l=a&&a[r]!==L[t]?1e3*a.elapsedTime+100:20;m&&setTimeout(function(){m=!1,N(L[t],v),D(L[o],v),D(L[t],"carousel-item-"+i),D(L[t],"carousel-item-"+R),D(L[o],"carousel-item-"+R),O.call(n,"slid","carousel",L[t]),e.hidden||!f.interval||I(n,"paused")||f.cycle()},l)})):(N(L[t],v),L[t].offsetWidth,D(L[o],v),setTimeout(function(){m=!1,f.interval&&!I(n,"paused")&&f.cycle(),O.call(n,"slid","carousel",L[t])},100)))}},this.getActiveIndex=function(){return L.indexOf(H(n,"carousel-item active")[0])||0},"Carousel"in n||(f.pause&&f.interval&&(S(n,T[0],q),S(n,T[1],F),S(n,E.start,q),S(n,E.end,F)),L[h]>1&&S(n,E.start,Q),X&&S(X,"click",G),P&&S(P,"click",G),j&&S(j,"click",Y),!0===f.keyboard&&S(t,"keydown",J)),f.getActiveIndex()<0&&(L[h]&&N(L[0],v),U[h]&&_(0)),f.interval&&f.cycle(),n.Carousel=f}};a[m](["Carousel",F,'[data-ride="carousel"]']);var Y=function(t,e){t=B(t),e=e||{};var i,n,o=null,a=null,l=this,r=t[c]("data-parent"),s=function(t,e){O.call(t,"show","collapse"),t.isAnimating=!0,N(t,"collapsing"),D(t,"collapse"),t[g].height=t.scrollHeight+"px",z(t,function(){t.isAnimating=!1,t[d]("aria-expanded","true"),e[d]("aria-expanded","true"),D(t,"collapsing"),N(t,"collapse"),N(t,"show"),t[g].height="",O.call(t,"shown","collapse")})},u=function(t,e){O.call(t,"hide","collapse"),t.isAnimating=!0,t[g].height=t.scrollHeight+"px",D(t,"collapse"),D(t,"show"),N(t,"collapsing"),t.offsetWidth,t[g].height="0px",z(t,function(){t.isAnimating=!1,t[d]("aria-expanded","false"),e[d]("aria-expanded","false"),D(t,"collapsing"),N(t,"collapse"),t[g].height="",O.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),I(a,"show")?l.hide():l.show()},this.hide=function(){a.isAnimating||(u(a,t),N(t,"collapsed"))},this.show=function(){o&&(i=B(".collapse.show",o),n=i&&(B('[data-target="#'+i.id+'"]',o)||B('[href="#'+i.id+'"]',o))),(!a.isAnimating||i&&!i.isAnimating)&&(n&&i!==a&&(u(i,n),N(n,"collapsed")),s(a,t),D(t,"collapsed"))},"Collapse"in t||S(t,"click",l.toggle),a=function(){var e=t.href&&t[c]("href"),i=t[c]("data-target"),n=e||i&&"#"===i.charAt(0)&&i;return n&&B(n)}(),a.isAnimating=!1,o=B(e.parent)||r&&M(t,r),t.Collapse=l};a[m](["Collapse",Y,'[data-toggle="collapse"]']);var G=function(t,i){t=B(t),this.persist=!0===i||"true"===t[c]("data-persist")||!1;var n=this,o=t[u],a=null,l=B(".dropdown-menu",o),s=function(){for(var t=l.children,e=[],i=0;i1?c-1:0:40===o&&c×',w=B(o.container),y=B(m),k=M(i,".modal"),C=M(i,".fixed-top"),x=M(i,".fixed-bottom");this.template=o.template?o.template:null,this.trigger=o.trigger?o.trigger:a||"hover",this[s]=o[s]&&"fade"!==o[s]?o[s]:u||"fade",this.placement=o.placement?o.placement:h||b,this[l]=parseInt(o[l]||p)||200,this.dismissible=!(!o.dismissible&&"true"!==f),this.container=w||(y||(C||(x||(k||e[n]))));var A=this,E=i[c]("data-title")||null,L=i[c]("data-content")||null;if(L||this.template){var H=null,R=0,P=this.placement,X=function(t){null!==H&&t[r]===B(".close",H)&&A.hide()},U=function(){A.container.removeChild(H),R=null,H=null},q=function(){E=o.title||i[c]("data-title")||null,L=o.content||i[c]("data-content")||null,H=e.createElement("div");var t=e.createElement("div");if(t[d]("class","arrow"),H.appendChild(t),null!==L&&null===A.template){if(H[d]("role","tooltip"),null!==E){var n=e.createElement("h3");n[d]("class","popover-header"),n.innerHTML=A.dismissible?E+v:E,H.appendChild(n)}var a=e.createElement("div");a[d]("class","popover-body"),a.innerHTML=A.dismissible&&null===E?L+v:L,H.appendChild(a)}else{var l=e.createElement("div");l.innerHTML=A.template,H.innerHTML=l.firstChild.innerHTML}A.container.appendChild(H),H[g].display="block",H[d]("class","popover bs-popover-"+P+" "+A[s])},F=function(){!I(H,"show")&&N(H,"show")},Y=function(){j(i,H,P,A.container)},G=function(n){"click"!=A.trigger&&"focus"!=A.trigger||!A.dismissible&&n(i,"blur",A.hide),A.dismissible&&n(e,"click",X),n(t,"resize",A.hide)},J=function(){G(S),O.call(i,"shown","popover")},K=function(){G(W),U(),O.call(i,"hidden","popover")};this.toggle=function(){null===H?A.show():A.hide()},this.show=function(){clearTimeout(R),R=setTimeout(function(){null===H&&(P=A.placement,q(),Y(),F(),O.call(i,"show","popover"),A[s]?z(H,J):J())},20)},this.hide=function(){clearTimeout(R),R=setTimeout(function(){H&&null!==H&&I(H,"show")&&(O.call(i,"hide","popover"),D(H,"show"),A[s]?z(H,K):K())},A[l])},"Popover"in i||("hover"===A.trigger?(S(i,T[0],A.show),A.dismissible||S(i,T[1],A.hide)):"click"!=A.trigger&&"focus"!=A.trigger||S(i,A.trigger,A.toggle)),i.Popover=A}};a[m](["Popover",K,'[data-toggle="popover"]']);var Q=function(e,i){e=B(e);var n=B(e[c]("data-target")),o=e[c]("data-offset");if(i=i||{},i[r]||n){for(var a,l=this,s=i[r]&&B(i[r])||n,d=s&&s.getElementsByTagName("A"),f=parseInt(i.offset||o)||10,p=[],g=[],w=e.offsetHeight=c&&d>a;if(!s&&h)I(i,v)||(N(i,v),l&&!I(l,v)&&N(l,v),O.call(e,"activate","scrollspy",p[t]));else if(h){if(!h&&!s||s&&h)return}else I(i,v)&&(D(i,v),l&&I(l,v)&&!H(i[u],v).length&&D(l,v))},E=function(){a=T?X().y:e.scrollTop;for(var t=0,i=p[h];t1&&(t=e[e[h]-1]):t=e[0],t},E=function(){return B(A()[c]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget,!m.isAnimating&&!I(n,v)&&p.show()};this.show=function(){n=n||t,l=B(n[c]("href")),o=A(),a=E(),m.isAnimating=!0,D(o,v),o[d]("aria-selected","false"),N(n,v),n[d]("aria-selected","true"),T&&(I(t[u],"dropdown-menu")?I(T,v)||N(T,v):I(T,v)&&D(T,v)),O.call(o,"hide","tab",n),I(a,"fade")?(D(a,"show"),z(a,x)):x()},"Tab"in t||S(t,"click",L),p.height&&(b=E()[u]),t.Tab=p}};a[m](["Tab",V,'[data-toggle="tab"]']);var Z=function(t,e){t=B(t),e=e||{};var i=t[c]("data-animation"),n=t[c]("data-autohide"),o=t[c]("data-delay");this.animation=!1===e.animation||"false"===i?0:1,this.autohide=!1===e.autohide||"false"===n?0:1,this[l]=parseInt(e[l]||o)||500;var a=this,r=0,s=M(t,".toast"),d=function(){D(s,"showing"),N(s,"show"),O.call(s,"shown","toast"),a.autohide&&a.hide()},u=function(){N(s,"hide"),O.call(s,"hidden","toast")},h=function(){D(s,"show"),a.animation?z(s,u):u()},f=function(){clearTimeout(r),r=null,N(s,"hide"),W(t,"click",a.hide),t.Toast=null,t=null,s=null};this.show=function(){s&&(O.call(s,"show","toast"),a.animation&&N(s,"fade"),D(s,"hide"),N(s,"showing"),a.animation?z(s,d):d())},this.hide=function(t){s&&I(s,"show")&&(O.call(s,"hide","toast"),t?h():r=setTimeout(h,a[l]))},this.dispose=function(){s&&I(s,"show")&&(D(s,"show"),a.animation?z(s,f):f())},"Toast"in t||S(t,"click",a.hide),t.Toast=a};a[m](["Toast",Z,'[data-dismiss="toast"]']);var $=function(i,o){i=B(i),o=o||{};var a=i[c]("data-animation"),r=i[c]("data-placement"),u=i[c]("data-delay"),h=i[c]("data-container"),f=B(o.container),p=B(h),g=M(i,".modal"),m=M(i,".fixed-top"),v=M(i,".fixed-bottom");this[s]=o[s]&&"fade"!==o[s]?o[s]:a||"fade",this.placement=o.placement?o.placement:r||b,this[l]=parseInt(o[l]||u)||200,this.container=f||(p||(m||(v||(g||e[n]))));var w=this,y=0,k=this.placement,C=null,x=i[c]("title")||i[c]("data-title")||i[c]("data-original-title");if(x&&""!=x){var A=function(){w.container.removeChild(C),C=null,y=null},E=function(){if(!(x=i[c]("title")||i[c]("data-title")||i[c]("data-original-title"))||""==x)return!1;C=e.createElement("div"),C[d]("role","tooltip");var t=e.createElement("div");t[d]("class","arrow"),C.appendChild(t);var n=e.createElement("div");n[d]("class","tooltip-inner"),C.appendChild(n),n.innerHTML=x,w.container.appendChild(C),C[d]("class","tooltip bs-tooltip-"+k+" "+w[s])},L=function(){j(i,C,k,w.container)},H=function(){!I(C,"show")&&N(C,"show")},R=function(){S(t,"resize",w.hide),O.call(i,"shown","tooltip")},P=function(){W(t,"resize",w.hide),A(),O.call(i,"hidden","tooltip")};this.show=function(){clearTimeout(y),y=setTimeout(function(){if(null===C){if(k=w.placement,0==E())return;L(),H(),O.call(i,"show","tooltip"),w[s]?z(C,R):R()}},20)},this.hide=function(){clearTimeout(y),y=setTimeout(function(){C&&I(C,"show")&&(O.call(i,"hide","tooltip"),D(C,"show"),w[s]?z(C,P):P())},w[l])},this.toggle=function(){C?w.hide():w.show()},"Tooltip"in i||(i[d]("data-original-title",x),i.removeAttribute("title"),S(i,T[0],w.show),S(i,T[1],w.hide)),i.Tooltip=w}};a[m](["Tooltip",$,'[data-toggle="tooltip"]']);var _=function(t,e){for(var i=0,n=e[h];i=u,A=g[b]+f.h/2+y.h/2>=h,I=g[b]-f.h<0,L=g[v]-f.w<0,B=g[b]+f.h+y.h>=h,H=g[v]+f.w+y.w>=u;a=(a===v||"right"===a)&&L&&H?b:a,a=a===b&&I?"bottom":a,a="bottom"===a&&B?b:a,a=a===v&&L?"right":a,a="right"===a&&H?v:a,a===v||"right"===a?(c=a===v?g[v]+m.x-f.w:g[v]+m.x+y.w,x?(r=g[b]+m.y,s=y.h/2):A?(r=g[b]+m.y-f.h+y.h,s=f.h-y.h/2):r=g[b]+m.y-f.h/2+y.h/2):a!==b&&"bottom"!==a||(r=a===b?g[b]+m.y-f.h:g[b]+m.y+y.h,k?(c=0,d=g[v]+y.w/2):C?(c=u-1.01*f.w,d=f.w-(u-g[v])+y.w/2):c=g[v]+m.x-f.w/2+y.w/2),o[p][b]=r+"px",o[p][v]=c+"px",s&&(w[p][b]=s+"px"),d&&(w[p][v]=d+"px"),-1===o.className.indexOf(a)&&(o.className=o.className.replace(T,a))};o.version="2.0.26";var F=function(o,a){o=S(o),a=a||{};var r=o[c]("data-target"),s=o[c]("data-offset-top"),d=o[c]("data-offset-bottom"),f="affix",u="function";if(this[l]=a[l]?S(a[l]):S(r)||null,this.offsetTop=a.offsetTop?a.offsetTop:parseInt(s)||0,this.offsetBottom=a.offsetBottom?a.offsetBottom:parseInt(d)||0,this[l]||this.offsetTop||this.offsetBottom){var h,p,g,m,v,w,T=this,x=!1,k=!1,C=function(){return Math.max(e[n].scrollHeight,e[n].offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight)},A=function(){return null!==T[l]?T[l].getBoundingClientRect()[b]+m:T.offsetTop?parseInt(typeof T.offsetTop===u?T.offsetTop():T.offsetTop||0):void 0},I=function(){if(T.offsetBottom)return g-o.offsetHeight-parseInt(typeof T.offsetBottom===u?T.offsetBottom():T.offsetBottom||0)},L=function(){g=C(),m=parseInt(q().y,0),h=A(),p=I(),v=parseInt(h)-m<0&&m>parseInt(h),w=parseInt(p)-m<0&&m>parseInt(p)},B=function(){x||N(o,f)||(j.call(o,f,f),j.call(o,"affix-top",f),H(o,f),x=!0,j.call(o,"affixed",f),j.call(o,"affixed-top",f))},M=function(){x&&N(o,f)&&(E(o,f),x=!1)},D=function(){k||N(o,"affix-bottom")||(j.call(o,f,f),j.call(o,"affix-bottom",f),H(o,"affix-bottom"),k=!0,j.call(o,"affixed",f),j.call(o,"affixed-bottom",f))},R=function(){k&&N(o,"affix-bottom")&&(E(o,"affix-bottom"),k=!1)},P=function(){w?(v&&M(),D()):(R(),v?B():M())};this.update=function(){L(),P()},"Affix"in o||(W(t,"scroll",T.update),!y&&W(t,"resize",T.update)),o.Affix=T,T.update()}};a[g](["Affix",F,'[data-spy="affix"]']);var Y=function(t){t=S(t);var e=this,i=R(t,".alert"),n=function(){N(i,"fade")?X(i,a):a()},o=function(n){i=R(n[l],".alert"),(t=S('[data-dismiss="alert"]',i))&&i&&(t===n[l]||t.contains(n[l]))&&e.close()},a=function(){j.call(i,"closed","alert"),P(t,"click",o),i[d].removeChild(i)};this.close=function(){i&&t&&N(i,"in")&&(j.call(i,"close","alert"),E(i,"in"),i&&n())},"Alert"in t||W(t,"click",o),t.Alert=e};a[g](["Alert",Y,'[data-dismiss="alert"]']);var G=function(t,i){t=S(t),i=i||null;var n=!1,o="checked",a=function(t){32===(t.which||t.keyCode)&&t[l]===e.activeElement&&u(t)},r=function(t){32===(t.which||t.keyCode)&&t.preventDefault()},u=function(e){var i="LABEL"===e[l].tagName?e[l]:"LABEL"===e[l][d].tagName?e[l][d]:null;if(i){var a=e[l],r=D(a[d],"btn"),u=i.getElementsByTagName("INPUT")[0];if(u){if("checkbox"===u.type&&(u[o]?(E(i,m),u[c](o),u.removeAttribute(o),u[o]=!1):(H(i,m),u[c](o),u[s](o,o),u[o]=!0),n||(n=!0,j.call(u,"change","button"),j.call(t,"change","button"))),"radio"===u.type&&!n&&!u[o]){H(i,m),u[s](o,o),u[o]=!0,j.call(u,"change","button"),j.call(t,"change","button"),n=!0;for(var h=0,p=r[f];h1?(t.preventDefault(),!1):void 0):void t.preventDefault()},Z=function(t){if(y&&!g&&(k=x||parseInt(t.touches[0].pageX),y)){if((!e.contains(t[l])||!e.contains(t.relatedTarget))&&Math.abs(T-k)<75)return!1;xT&&h--,y=!1,u.slideTo(h),K(P)}},$=function(){var n=e.getBoundingClientRect(),o=t.innerHeight||i.clientHeight;return n[b]<=o&&n.bottom>=0},_=function(t){for(var e=0,i=q[f];et||n===I-1&&0===t)&&(B=u.direction="right"),t<0?t=I-1:t>=I&&(t=0),h=t,i=B===v?"next":"prev",j.call(e,"slide","carousel",A[t]),g=!0,clearInterval(p),p=null,_(t),C&&N(e,"slide")?(H(A[t],i),A[t].offsetWidth,H(A[t],B),H(A[n],B),X(A[t],function(o){var a=o&&o[l]!==A[t]?1e3*o.elapsedTime+100:20;g&&setTimeout(function(){g=!1,H(A[t],m),E(A[n],m),E(A[t],i),E(A[t],B),E(A[n],B),j.call(e,"slid","carousel",A[t]),u.interval&&!N(e,"paused")&&u.cycle()},a)})):(H(A[t],m),A[t].offsetWidth,E(A[n],m),setTimeout(function(){g=!1,u.interval&&!N(e,"paused")&&u.cycle(),j.call(e,"slid","carousel",A[t])},100)))}},this.getActiveIndex=function(){return A.indexOf(D(e,"item active")[0])||0},"Carousel"in e||(u.pause&&u.interval&&(W(e,w[0],U),W(e,w[1],F),W(e,L.start,U),W(e,L.end,F)),A[f]>1&&W(e,L.start,Q),z&&W(z,"click",G),R&&W(R,"click",G),O&&W(O,"click",Y),u.keyboard&&W(t,"keydown",J)),u.getActiveIndex()<0&&(A[f]&&H(A[0],m),q[f]&&_(0)),u.interval&&u.cycle(),e.Carousel=u}};a[g](["Carousel",J,'[data-ride="carousel"]']);var K=function(t,e){t=S(t),e=e||{};var i,n,o=null,a=null,l=this,r=t[c]("data-parent"),d=function(t,e){j.call(t,"show","collapse"),t.isAnimating=!0,H(t,"collapsing"),E(t,"collapse"),t[p].height=t.scrollHeight+"px",X(t,function(){t.isAnimating=!1,t[s]("aria-expanded","true"),e[s]("aria-expanded","true"),E(t,"collapsing"),H(t,"collapse"),H(t,"in"),t[p].height="",j.call(t,"shown","collapse")})},f=function(t,e){j.call(t,"hide","collapse"),t.isAnimating=!0,t[p].height=t.scrollHeight+"px",E(t,"collapse"),E(t,"in"),H(t,"collapsing"),t.offsetWidth,t[p].height="0px",X(t,function(){t.isAnimating=!1,t[s]("aria-expanded","false"),e[s]("aria-expanded","false"),E(t,"collapsing"),H(t,"collapse"),t[p].height="",j.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),N(a,"in")?l.hide():l.show()},this.hide=function(){a.isAnimating||(f(a,t),H(t,"collapsed"))},this.show=function(){o&&(i=S(".collapse.in",o),n=i&&(S('[data-target="#'+i.id+'"]',o)||S('[href="#'+i.id+'"]',o))),(!a.isAnimating||i&&!i.isAnimating)&&(n&&i!==a&&(f(i,n),H(n,"collapsed")),d(a,t),E(t,"collapsed"))},"Collapse"in t||W(t,"click",l.toggle),a=function(){var e=t.href&&t[c]("href"),i=t[c]("data-target"),n=e||i&&"#"===i.charAt(0)&&i;return n&&S(n)}(),a.isAnimating=!1,o=S(e.parent)||r&&R(t,r),t.Collapse=l};a[g](["Collapse",K,'[data-toggle="collapse"]']);var Q=function(t,i){t=S(t),this.persist=!0===i||"true"===t[c]("data-persist")||!1;var n=this,o=t[d],a="open",r=null,u=S(".dropdown-menu",o),h=function(){for(var t=u.children,e=[],i=0;i1?c-1:0:40===o&&c×',v=S(o.container),T=S(g),x=R(i,".modal"),C=R(i,"."+k),A=R(i,".navbar-fixed-bottom");this.template=o.template?o.template:null,this.trigger=o.trigger?o.trigger:a||"hover",this[r]=o[r]&&"fade"!==o[r]?o[r]:d||"fade",this.placement=o.placement?o.placement:f||b,this.delay=parseInt(o.delay||h)||200,this.dismissible=!(!o.dismissible&&"true"!==u),this.container=v||(T||(C||(A||(x||e[n]))));var I=this,L=o.title||i[c]("data-title")||null,B=o.content||i[c]("data-content")||null;if(B||this.template){var M=null,D=0,z=this.placement,O=function(t){null!==M&&t[l]===S(".close",M)&&I.hide()},q=function(){I.container.removeChild(M),D=null,M=null},F=function(){if(L=i[c]("data-title"),B=i[c]("data-content"),M=e.createElement("div"),null!==B&&null===I.template){if(M[s]("role","tooltip"),null!==L){var t=e.createElement("h3");t[s]("class","popover-title"),t.innerHTML=I.dismissible?L+m:L,M.appendChild(t)}var n=e.createElement("div"),o=e.createElement("div");n[s]("class","arrow"),o[s]("class","popover-content"),M.appendChild(n),M.appendChild(o),o.innerHTML=I.dismissible&&null===L?B+m:B}else{var a=e.createElement("div");a.innerHTML=I.template,M.innerHTML=a.firstChild.innerHTML}I.container.appendChild(M),M[p].display="block",M[s]("class","popover "+z+" "+I[r])},Y=function(){!N(M,"in")&&H(M,"in")},G=function(){U(i,M,z,I.container)},J=function(n){"click"!=I.trigger&&"focus"!=I.trigger||!I.dismissible&&n(i,"blur",I.hide),I.dismissible&&n(e,"click",O),!y&&n(t,"resize",I.hide)},K=function(){J(W),j.call(i,"shown","popover")},Q=function(){J(P),q(),j.call(i,"hidden","popover")};this.toggle=function(){null===M?I.show():I.hide()},this.show=function(){clearTimeout(D),D=setTimeout(function(){null===M&&(z=I.placement,F(),G(),Y(),j.call(i,"show","popover"),I[r]?X(M,K):K())},20)},this.hide=function(){clearTimeout(D),D=setTimeout(function(){M&&null!==M&&N(M,"in")&&(j.call(i,"hide","popover"),E(M,"in"),I[r]?X(M,Q):Q())},I.delay)},"Popover"in i||("hover"===I.trigger?(W(i,w[0],I.show),I.dismissible||W(i,w[1],I.hide)):"click"!=I.trigger&&"focus"!=I.trigger||W(i,I.trigger,I.toggle)),i.Popover=I}};a[g](["Popover",Z,'[data-toggle="popover"]']);var $=function(e,i){e=S(e);var n=S(e[c]("data-target")),o=e[c]("data-offset");if(i=i||{},i[l]||n){for(var a,r=this,s=i[l]&&S(i[l])||n,u=s&&s.getElementsByTagName("A"),h=parseInt(i.offset||o)||10,p=[],v=[],w=e.offsetHeight=c&&s>a;if(!r&&f)"LI"!==i.tagName||N(i,m)||(H(i,m),o&&!N(o,m)&&H(o,m),j.call(e,"activate","scrollspy",p[t]));else if(f){if(!f&&!r||r&&f)return}else"LI"===i.tagName&&N(i,m)&&(E(i,m),o&&N(o,m)&&!D(i[d],m).length&&E(o,m))},L=function(){a=T?q().y:e.scrollTop;for(var t=0,i=p[f];t1&&(t=e[e[f]-1]):t=e[0],t.getElementsByTagName("A")[0]},I=function(){return S(A()[c]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget||this,!b.isAnimating&&!N(n[d],m)&&g.show()};this.show=function(){n=n||t,l=S(n[c]("href")),o=A(),a=I(),b.isAnimating=!0,E(o[d],m),o[s]("aria-expanded","false"),H(n[d],m),n[s]("aria-expanded","true"),w&&(N(t[d][d],"dropdown-menu")?N(w,m)||H(w,m):N(w,m)&&E(w,m)),j.call(o,"hide","tab",n),N(a,"fade")?(E(a,"in"),X(a,k)):k()},"Tab"in t||W(t,"click",L),g.height&&(y=I()[d]),t.Tab=g}};a[g](["Tab",_,'[data-toggle="tab"]']);var tt=function(i,o){i=S(i),o=o||{};var a=i[c]("data-animation"),l=i[c]("data-placement"),d=i[c]("data-delay"),f=i[c]("data-container"),u=S(o.container),h=S(f),p=R(i,".modal"),g=R(i,"."+k),m=R(i,".navbar-fixed-bottom");this[r]=o[r]&&"fade"!==o[r]?o[r]:a||"fade",this.placement=o.placement?o.placement:l||b,this.delay=parseInt(o.delay||d)||200,this.container=u||(h||(g||(m||(p||e[n]))));var v=this,T=0,x=this.placement,C=null,A=i[c]("title")||i[c]("data-title")||i[c]("data-original-title");if(A&&""!=A){var I=function(){v.container.removeChild(C),C=null,T=null},L=function(){if(!(A=i[c]("title")||i[c]("data-title")||i[c]("data-original-title"))||""==A)return!1;C=e.createElement("div"),C[s]("role","tooltip");var t=e.createElement("div"),n=e.createElement("div");t[s]("class","tooltip-arrow"),n[s]("class","tooltip-inner"),C.appendChild(t),C.appendChild(n),n.innerHTML=A,v.container.appendChild(C),C[s]("class","tooltip "+x+" "+v[r])},B=function(){U(i,C,x,v.container)},M=function(){!N(C,"in")&&H(C,"in")},D=function(){j.call(i,"shown","tooltip"),!y&&W(t,"resize",v.hide)},z=function(){!y&&P(t,"resize",v.hide),I(),j.call(i,"hidden","tooltip")};this.show=function(){clearTimeout(T),T=setTimeout(function(){if(null===C){if(x=v.placement,0==L())return;B(),M(),j.call(i,"show","tooltip"),v[r]?X(C,D):D()}},20)},this.hide=function(){clearTimeout(T),T=setTimeout(function(){C&&N(C,"in")&&(j.call(i,"hide","tooltip"),E(C,"in"),v[r]?X(C,z):z())},v.delay)},this.toggle=function(){C?v.hide():v.show()},"Tooltip"in i||(i[s]("data-original-title",A),i.removeAttribute("title"),W(i,w[0],v.show),W(i,w[1],v.hide)),i.Tooltip=v}};a[g](["Tooltip",tt,'[data-toggle="tooltip"]']);var et=function(t,e){for(var i=0,n=e[f];i=u,A=g[b]+f.h/2+y.h/2>=h,I=g[b]-f.h<0,L=g[v]-f.w<0,B=g[b]+f.h+y.h>=h,H=g[v]+f.w+y.w>=u;a=(a===v||"right"===a)&&L&&H?b:a,a=a===b&&I?"bottom":a,a="bottom"===a&&B?b:a,a=a===v&&L?"right":a,a="right"===a&&H?v:a,a===v||"right"===a?(c=a===v?g[v]+m.x-f.w:g[v]+m.x+y.w,x?(r=g[b]+m.y,s=y.h/2):A?(r=g[b]+m.y-f.h+y.h,s=f.h-y.h/2):r=g[b]+m.y-f.h/2+y.h/2):a!==b&&"bottom"!==a||(r=a===b?g[b]+m.y-f.h:g[b]+m.y+y.h,k?(c=0,d=g[v]+y.w/2):C?(c=u-1.01*f.w,d=f.w-(u-g[v])+y.w/2):c=g[v]+m.x-f.w/2+y.w/2),o[p][b]=r+"px",o[p][v]=c+"px",s&&(w[p][b]=s+"px"),d&&(w[p][v]=d+"px"),-1===o.className.indexOf(a)&&(o.className=o.className.replace(T,a))};o.version="2.0.27";var F=function(o,a){o=S(o),a=a||{};var r=o[c]("data-target"),s=o[c]("data-offset-top"),d=o[c]("data-offset-bottom"),f="affix",u="function";if(this[l]=a[l]?S(a[l]):S(r)||null,this.offsetTop=a.offsetTop?a.offsetTop:parseInt(s)||0,this.offsetBottom=a.offsetBottom?a.offsetBottom:parseInt(d)||0,this[l]||this.offsetTop||this.offsetBottom){var h,p,g,m,v,w,T=this,x=!1,k=!1,C=function(){return Math.max(e[n].scrollHeight,e[n].offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight)},A=function(){return null!==T[l]?T[l].getBoundingClientRect()[b]+m:T.offsetTop?parseInt(typeof T.offsetTop===u?T.offsetTop():T.offsetTop||0):void 0},I=function(){if(T.offsetBottom)return g-o.offsetHeight-parseInt(typeof T.offsetBottom===u?T.offsetBottom():T.offsetBottom||0)},L=function(){g=C(),m=parseInt(q().y,0),h=A(),p=I(),v=parseInt(h)-m<0&&m>parseInt(h),w=parseInt(p)-m<0&&m>parseInt(p)},B=function(){x||N(o,f)||(j.call(o,f,f),j.call(o,"affix-top",f),H(o,f),x=!0,j.call(o,"affixed",f),j.call(o,"affixed-top",f))},M=function(){x&&N(o,f)&&(E(o,f),x=!1)},D=function(){k||N(o,"affix-bottom")||(j.call(o,f,f),j.call(o,"affix-bottom",f),H(o,"affix-bottom"),k=!0,j.call(o,"affixed",f),j.call(o,"affixed-bottom",f))},R=function(){k&&N(o,"affix-bottom")&&(E(o,"affix-bottom"),k=!1)},P=function(){w?(v&&M(),D()):(R(),v?B():M())};this.update=function(){L(),P()},"Affix"in o||(W(t,"scroll",T.update),!y&&W(t,"resize",T.update)),o.Affix=T,T.update()}};a[g](["Affix",F,'[data-spy="affix"]']);var Y=function(t){t=S(t);var e=this,i=R(t,".alert"),n=function(){N(i,"fade")?X(i,a):a()},o=function(n){i=R(n[l],".alert"),(t=S('[data-dismiss="alert"]',i))&&i&&(t===n[l]||t.contains(n[l]))&&e.close()},a=function(){j.call(i,"closed","alert"),P(t,"click",o),i[d].removeChild(i)};this.close=function(){i&&t&&N(i,"in")&&(j.call(i,"close","alert"),E(i,"in"),i&&n())},"Alert"in t||W(t,"click",o),t.Alert=e};a[g](["Alert",Y,'[data-dismiss="alert"]']);var G=function(t,i){t=S(t),i=i||null;var n=!1,o="checked",a=function(t){32===(t.which||t.keyCode)&&t[l]===e.activeElement&&u(t)},r=function(t){32===(t.which||t.keyCode)&&t.preventDefault()},u=function(e){var i="LABEL"===e[l].tagName?e[l]:"LABEL"===e[l][d].tagName?e[l][d]:null;if(i){var a=e[l],r=D(a[d],"btn"),u=i.getElementsByTagName("INPUT")[0];if(u){if("checkbox"===u.type&&(u[o]?(E(i,m),u[c](o),u.removeAttribute(o),u[o]=!1):(H(i,m),u[c](o),u[s](o,o),u[o]=!0),n||(n=!0,j.call(u,"change","button"),j.call(t,"change","button"))),"radio"===u.type&&!n&&!u[o]){H(i,m),u[s](o,o),u[o]=!0,j.call(u,"change","button"),j.call(t,"change","button"),n=!0;for(var h=0,p=r[f];h1?(t.preventDefault(),!1):void 0):void t.preventDefault()},Z=function(t){if(y&&!g&&(k=x||parseInt(t.touches[0].pageX),y)){if((!e.contains(t[l])||!e.contains(t.relatedTarget))&&Math.abs(T-k)<75)return!1;xT&&h--,y=!1,u.slideTo(h),K(P)}},$=function(){var n=e.getBoundingClientRect(),o=t.innerHeight||i.clientHeight;return n[b]<=o&&n.bottom>=0},_=function(t){for(var e=0,i=q[f];et||n===I-1&&0===t)&&(B=u.direction="right"),t<0?t=I-1:t>=I&&(t=0),h=t,i=B===v?"next":"prev",j.call(e,"slide","carousel",A[t]),g=!0,clearInterval(p),p=null,_(t),C&&N(e,"slide")?(H(A[t],i),A[t].offsetWidth,H(A[t],B),H(A[n],B),X(A[t],function(o){var a=o&&o[l]!==A[t]?1e3*o.elapsedTime+100:20;g&&setTimeout(function(){g=!1,H(A[t],m),E(A[n],m),E(A[t],i),E(A[t],B),E(A[n],B),j.call(e,"slid","carousel",A[t]),u.interval&&!N(e,"paused")&&u.cycle()},a)})):(H(A[t],m),A[t].offsetWidth,E(A[n],m),setTimeout(function(){g=!1,u.interval&&!N(e,"paused")&&u.cycle(),j.call(e,"slid","carousel",A[t])},100)))}},this.getActiveIndex=function(){return A.indexOf(D(e,"item active")[0])||0},"Carousel"in e||(u.pause&&u.interval&&(W(e,w[0],U),W(e,w[1],F),W(e,L.start,U),W(e,L.end,F)),A[f]>1&&W(e,L.start,Q),z&&W(z,"click",G),R&&W(R,"click",G),O&&W(O,"click",Y),u.keyboard&&W(t,"keydown",J)),u.getActiveIndex()<0&&(A[f]&&H(A[0],m),q[f]&&_(0)),u.interval&&u.cycle(),e.Carousel=u}};a[g](["Carousel",J,'[data-ride="carousel"]']);var K=function(t,e){t=S(t),e=e||{};var i,n,o=null,a=null,l=this,r=t[c]("data-parent"),d=function(t,e){j.call(t,"show","collapse"),t.isAnimating=!0,H(t,"collapsing"),E(t,"collapse"),t[p].height=t.scrollHeight+"px",X(t,function(){t.isAnimating=!1,t[s]("aria-expanded","true"),e[s]("aria-expanded","true"),E(t,"collapsing"),H(t,"collapse"),H(t,"in"),t[p].height="",j.call(t,"shown","collapse")})},f=function(t,e){j.call(t,"hide","collapse"),t.isAnimating=!0,t[p].height=t.scrollHeight+"px",E(t,"collapse"),E(t,"in"),H(t,"collapsing"),t.offsetWidth,t[p].height="0px",X(t,function(){t.isAnimating=!1,t[s]("aria-expanded","false"),e[s]("aria-expanded","false"),E(t,"collapsing"),H(t,"collapse"),t[p].height="",j.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),N(a,"in")?l.hide():l.show()},this.hide=function(){a.isAnimating||(f(a,t),H(t,"collapsed"))},this.show=function(){o&&(i=S(".collapse.in",o),n=i&&(S('[data-target="#'+i.id+'"]',o)||S('[href="#'+i.id+'"]',o))),(!a.isAnimating||i&&!i.isAnimating)&&(n&&i!==a&&(f(i,n),H(n,"collapsed")),d(a,t),E(t,"collapsed"))},"Collapse"in t||W(t,"click",l.toggle),a=function(){var e=t.href&&t[c]("href"),i=t[c]("data-target"),n=e||i&&"#"===i.charAt(0)&&i;return n&&S(n)}(),a.isAnimating=!1,o=S(e.parent)||r&&R(t,r),t.Collapse=l};a[g](["Collapse",K,'[data-toggle="collapse"]']);var Q=function(t,i){t=S(t),this.persist=!0===i||"true"===t[c]("data-persist")||!1;var n=this,o=t[d],a="open",r=null,u=S(".dropdown-menu",o),h=function(){for(var t=u.children,e=[],i=0;i1?c-1:0:40===o&&c×',v=S(o.container),T=S(g),x=R(i,".modal"),C=R(i,"."+k),A=R(i,".navbar-fixed-bottom");this.template=o.template?o.template:null,this.trigger=o.trigger?o.trigger:a||"hover",this[r]=o[r]&&"fade"!==o[r]?o[r]:d||"fade",this.placement=o.placement?o.placement:f||b,this.delay=parseInt(o.delay||h)||200,this.dismissible=!(!o.dismissible&&"true"!==u),this.container=v||(T||(C||(A||(x||e[n]))));var I=this,L=o.title||i[c]("data-title")||null,B=o.content||i[c]("data-content")||null;if(B||this.template){var M=null,D=0,z=this.placement,O=function(t){null!==M&&t[l]===S(".close",M)&&I.hide()},q=function(){I.container.removeChild(M),D=null,M=null},F=function(){if(L=i[c]("data-title"),B=i[c]("data-content"),M=e.createElement("div"),null!==B&&null===I.template){if(M[s]("role","tooltip"),null!==L){var t=e.createElement("h3");t[s]("class","popover-title"),t.innerHTML=I.dismissible?L+m:L,M.appendChild(t)}var n=e.createElement("div"),o=e.createElement("div");n[s]("class","arrow"),o[s]("class","popover-content"),M.appendChild(n),M.appendChild(o),o.innerHTML=I.dismissible&&null===L?B+m:B}else{var a=e.createElement("div");a.innerHTML=I.template,M.innerHTML=a.firstChild.innerHTML}I.container.appendChild(M),M[p].display="block",M[s]("class","popover "+z+" "+I[r])},Y=function(){!N(M,"in")&&H(M,"in")},G=function(){U(i,M,z,I.container)},J=function(n){"click"!=I.trigger&&"focus"!=I.trigger||!I.dismissible&&n(i,"blur",I.hide),I.dismissible&&n(e,"click",O),!y&&n(t,"resize",I.hide)},K=function(){J(W),j.call(i,"shown","popover")},Q=function(){J(P),q(),j.call(i,"hidden","popover")};this.toggle=function(){null===M?I.show():I.hide()},this.show=function(){clearTimeout(D),D=setTimeout(function(){null===M&&(z=I.placement,F(),G(),Y(),j.call(i,"show","popover"),I[r]?X(M,K):K())},20)},this.hide=function(){clearTimeout(D),D=setTimeout(function(){M&&null!==M&&N(M,"in")&&(j.call(i,"hide","popover"),E(M,"in"),I[r]?X(M,Q):Q())},I.delay)},"Popover"in i||("hover"===I.trigger?(W(i,w[0],I.show),I.dismissible||W(i,w[1],I.hide)):"click"!=I.trigger&&"focus"!=I.trigger||W(i,I.trigger,I.toggle)),i.Popover=I}};a[g](["Popover",Z,'[data-toggle="popover"]']);var $=function(e,i){e=S(e);var n=S(e[c]("data-target")),o=e[c]("data-offset");if(i=i||{},i[l]||n){for(var a,r=this,s=i[l]&&S(i[l])||n,u=s&&s.getElementsByTagName("A"),h=parseInt(i.offset||o)||10,p=[],v=[],w=e.offsetHeight=c&&s>a;if(!r&&f)"LI"!==i.tagName||N(i,m)||(H(i,m),o&&!N(o,m)&&H(o,m),j.call(e,"activate","scrollspy",p[t]));else if(f){if(!f&&!r||r&&f)return}else"LI"===i.tagName&&N(i,m)&&(E(i,m),o&&N(o,m)&&!D(i[d],m).length&&E(o,m))},L=function(){a=T?q().y:e.scrollTop;for(var t=0,i=p[f];t1&&(t=e[e[f]-1]):t=e[0],t.getElementsByTagName("A")[0]},I=function(){return S(A()[c]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget||this,!b.isAnimating&&!N(n[d],m)&&g.show()};this.show=function(){n=n||t,l=S(n[c]("href")),o=A(),a=I(),b.isAnimating=!0,E(o[d],m),o[s]("aria-expanded","false"),H(n[d],m),n[s]("aria-expanded","true"),w&&(N(t[d][d],"dropdown-menu")?N(w,m)||H(w,m):N(w,m)&&E(w,m)),j.call(o,"hide","tab",n),N(a,"fade")?(E(a,"in"),X(a,k)):k()},"Tab"in t||W(t,"click",L),g.height&&(y=I()[d]),t.Tab=g}};a[g](["Tab",_,'[data-toggle="tab"]']);var tt=function(i,o){i=S(i),o=o||{};var a=i[c]("data-animation"),l=i[c]("data-placement"),d=i[c]("data-delay"),f=i[c]("data-container"),u=S(o.container),h=S(f),p=R(i,".modal"),g=R(i,"."+k),m=R(i,".navbar-fixed-bottom");this[r]=o[r]&&"fade"!==o[r]?o[r]:a||"fade",this.placement=o.placement?o.placement:l||b,this.delay=parseInt(o.delay||d)||200,this.container=u||(h||(g||(m||(p||e[n]))));var v=this,T=0,x=this.placement,C=null,A=i[c]("title")||i[c]("data-title")||i[c]("data-original-title");if(A&&""!=A){var I=function(){v.container.removeChild(C),C=null,T=null},L=function(){if(!(A=i[c]("title")||i[c]("data-title")||i[c]("data-original-title"))||""==A)return!1;C=e.createElement("div"),C[s]("role","tooltip");var t=e.createElement("div"),n=e.createElement("div");t[s]("class","tooltip-arrow"),n[s]("class","tooltip-inner"),C.appendChild(t),C.appendChild(n),n.innerHTML=A,v.container.appendChild(C),C[s]("class","tooltip "+x+" "+v[r])},B=function(){U(i,C,x,v.container)},M=function(){!N(C,"in")&&H(C,"in")},D=function(){j.call(i,"shown","tooltip"),!y&&W(t,"resize",v.hide)},z=function(){!y&&P(t,"resize",v.hide),I(),j.call(i,"hidden","tooltip")};this.show=function(){clearTimeout(T),T=setTimeout(function(){if(null===C){if(x=v.placement,0==L())return;B(),M(),j.call(i,"show","tooltip"),v[r]?X(C,D):D()}},20)},this.hide=function(){clearTimeout(T),T=setTimeout(function(){C&&N(C,"in")&&(j.call(i,"hide","tooltip"),E(C,"in"),v[r]?X(C,z):z())},v.delay)},this.toggle=function(){C?v.hide():v.show()},"Tooltip"in i||(i[s]("data-original-title",A),i.removeAttribute("title"),W(i,w[0],v.show),W(i,w[1],v.hide)),i.Tooltip=v}};a[g](["Tooltip",tt,'[data-toggle="tooltip"]']);var et=function(t,e){for(var i=0,n=e[f];i
  • Facebook
  • - Twitter
  • Google+
  • @@ -113,9 +113,9 @@

    A better way to Bootstrap

    @@ -125,7 +125,7 @@

    New to native JavaScript?

    @@ -164,7 +164,7 @@

    This was a Carousel example

    Read First

    Welcome to the demo page! Before you do anything, please make sure to check the Wiki pages, as they give you a quick start with using the library and also provide a good set of valuable guides on how to get the best out of it.

    - +

    Acknowledgements

    @@ -199,7 +199,7 @@

    Modal

    In addition to adapting the spacing (padding) of the <body> elements like <nav class="navbar-fixed-top"> are also adapted in the same manner to get the smoothest possible transition. Like all components of the library, the component has the ability to provide access to the initialization even if your modal is setup via DATA API.

    Options

    -

    The remote option have been removed in Bootstrap 4 and we already replaced it with a better option. We also skipped the show option because via JavaScript we quickly and easily access +

    The remote option have been removed in Bootstrap 4 and we already replaced it with a better option. We also skipped the show option because via JavaScript we quickly and easily access the component's public methods right after initialiation, we'll have a look in a minute.

    @@ -253,17 +253,17 @@

    .toggle()

    .setContent()

    -

    The method to enable you to set/override the content of <div class="modal-content"> element of your modal at any time, but you might want to avoid +

    The method to enable you to set/override the content of <div class="modal-content"> element of your modal at any time, but you might want to avoid using this method while the modal is animating.

    .update()

    -

    This allows you to update the modal layout (handling overflowing/non-overflowing body and/or modal) after you have changed it's content or other layout changes occured. +

    This allows you to update the modal layout (handling overflowing/non-overflowing body and/or modal) after you have changed it's content or other layout changes occured. This would naturally follow the previous .setContent() method.

    - +

    Events

    @@ -277,7 +277,7 @@

    Events

    - @@ -295,13 +295,13 @@

    Events

    show.bs.modalThis event fires immediately when the .show() instance method is called. If caused by a click and the clicked element is a modal triggering element, that element is available + This event fires immediately when the .show() instance method is called. If caused by a click and the clicked element is a modal triggering element, that element is available as the event.relatedTarget property of the event.
    -

    The loaded.bs.modal original event is not needed, also because we replaced the remote option with another one. If modal is opened via JavaScript methods, or by clicking +

    The loaded.bs.modal original event is not needed, also because we replaced the remote option with another one. If modal is opened via JavaScript methods, or by clicking on another element that is not a modal triggering element, the relatedTarget is null.

    Usage

    Via DATA API
    -

    You can initialize Modal without writing any code as long as you have a modal and a trigger with data-target or a link with href referencing that modal. The component +

    You can initialize Modal without writing any code as long as you have a modal and a trigger with data-target or a link with href referencing that modal. The component will initialize for all elements with data-toggle="modal" found in the DOM.

    <!-- provide a trigger button -->
    @@ -329,11 +329,11 @@ 
    Via DATA API
    </div> </div>
    - +

    The DATA API is suited for static content dialogs.

    - +
    Via JavaScript
    -

    When you write your code, first make sure a modal template is present in the DOM. Generally you can initialize Modal for any instance of <div class="modal"> and immediately get access to methods. Alternativelly you can initialize on a triggering element, similar to how the DATA API works, in this case the data-toggle="modal" is not required, but you need to specify a modal reference via a specific attribute, like so <button data-target="#modalId"> or <a href="#modalId">.

    +

    When you write your code, first make sure a modal template is present in the DOM. Generally you can initialize Modal for any instance of <div class="modal"> and immediately get access to methods. Alternativelly you can initialize on a triggering element, similar to how the DATA API works, in this case the data-toggle="modal" is not required, but you need to specify a modal reference via a specific attribute, like so <button data-target="#modalId"> or <a href="#modalId">.

    The JavaScript way is the only way to deal with dynamically added modals. Let's create a very basic modal template for the record.

    <!-- blank modal template -->
    @@ -353,7 +353,7 @@ 
    Via JavaScript
    // initialize on a <div class="modal"> with all options // Note: options object is optional -var myModalInstance = new Modal(myModal, +var myModalInstance = new Modal(myModal, { // options object content: '<div class="modal-body">Some content to be set on init</div>', // sets modal content backdrop: 'static', // we don't want to dismiss Modal when Modal or backdrop is the click event target @@ -381,7 +381,7 @@
    Via JavaScript
    var myButton = document.getElementById('buttonID'); // initiate Modal on a triggering element -var myModalInstance = new Modal(myButton, +var myModalInstance = new Modal(myButton, { // options object content: '<div class="modal-body">Some content to be set on init</div>', // sets modal content keyboard: false // we don't want to dismiss Modal on pressing Esc key @@ -412,11 +412,11 @@
    Via JavaScript
    // when we are certain which modal ID to work with var myModal = document.getElementById('modalID'); -// also button trigger related (especially when modals are targeted by multiple triggering elements) +// also button trigger related (especially when modals are targeted by multiple triggering elements) // a triggering element is a link -var myModal = document.getElementById(myModalTriggerButton.getAttribute('href').replace('#','')); +var myModal = document.getElementById(myModalTriggerButton.getAttribute('href').replace('#','')); // OR triggering element is not a link -var myModal = document.getElementById(myModalTriggerButton.getAttribute('data-target').replace('#','')); +var myModal = document.getElementById(myModalTriggerButton.getAttribute('data-target').replace('#','')); // ATTACH HANDLERS // show.bs.modal event @@ -460,9 +460,9 @@
    Via JavaScript
    // when a modal was initialized via DATA API
     // OR a triggering element is the target of the Modal constructor
    -var myModalInstance === document.getElementById('myModalTrigger').Modal; 
    +var myModalInstance === document.getElementById('myModalTrigger').Modal;
     
    - +

    These references are used internally to hide currently visible modals when showing another one. When the component is used via JavaScript only without a triggering element, you need to manually hide (via .hide() instance method) any visible modal before showing another modal (via the .show() instance method).

    @@ -470,7 +470,7 @@
    Via JavaScript

    Examples

    Using the DATA API
    -

    The first example is a modal with static content initialized via DATA API, exactly as described in the above Use via DATA API section, and showcasing the +

    The first example is a modal with static content initialized via DATA API, exactly as described in the above Use via DATA API section, and showcasing the ability to show another modal from a modal currently visible.

    @@ -513,22 +513,22 @@

    Overflowing text to show scroll behavior

    -
    Via JavaScript
    -

    The following examples are focused on everything the Modal component offers for JavaScript initialization and usage. Given a modal template and some buttons to open the modal on click, +

    The following examples are focused on everything the Modal component offers for JavaScript initialization and usage. Given a modal template and some buttons to open the modal on click, let's initialize it first:

    // we grab a modal by ID
    @@ -588,7 +588,7 @@ 
    Via JavaScript
    }; // set a custom modal-content template -var secondModalContent = +var secondModalContent = '<div class="modal-header">' +'<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +'<span aria-hidden="true">×</span>' @@ -612,10 +612,10 @@
    Via JavaScript
    // now when we click this modal triggering element, we change the modal content btnModal2.addEventListener('click', function() { modalInitJS2.setContent(secondModalContent); -}, false); +}, false);
    -

    By changing the innerHTML of the modal-header, modal-body or modal-footer with variables, you can achieve exactly the same as the +

    By changing the innerHTML of the modal-header, modal-body or modal-footer with variables, you can achieve exactly the same as the other examples from the demo of the original plugin. So we use same modal, but with different content:

    Open Modal

    @@ -641,7 +641,7 @@
    Via JavaScript
    -

    Another example is using the .update() method. Let's say we have a modal initialized via DATA API, you might think we cannot access this instance's methods. Remember the trigger button +

    Another example is using the .update() method. Let's say we have a modal initialized via DATA API, you might think we cannot access this instance's methods. Remember the trigger button stores the initialization?

    var modalUpdate = document.getElementById('modalUpdate'), // the trigger
    @@ -666,37 +666,37 @@ 
    Via JavaScript

    A quick demo to showcase the above script:

    Show modal

    - + - + @@ -849,9 +849,9 @@
    Via JavaScript
    // event.target is the PARENT of the triggering element }, false);
    -

    When your dropdown-menus have a different structure and the myDropdown.parentNode is NOT the <div class="dropdown"> element, you might consider a +

    When your dropdown-menus have a different structure and the myDropdown.parentNode is NOT the <div class="dropdown"> element, you might consider a getClosest() function to find it so you can then attach the original events to it.

    - +

    Now, the Dropdown component also stores the initialization object in the targeted elements, just as for the modal triggering buttons:

    // get some element we know it was initialized
    @@ -911,17 +911,17 @@ 

    Examples

    var DropdownInit = new Dropdown(formDropdown, true); // also attach Dropdown original events - formDropdown.parentNode.addEventListener('show.bs.dropdown', function(e){ - console.log('Do something when the event fires'); + formDropdown.parentNode.addEventListener('show.bs.dropdown', function(e){ + console.log('Do something when the event fires'); }, false); - formDropdown.parentNode.addEventListener('shown.bs.dropdown', function(e){ - console.log('Do something when the event fires'); + formDropdown.parentNode.addEventListener('shown.bs.dropdown', function(e){ + console.log('Do something when the event fires'); }, false); - formDropdown.parentNode.addEventListener('hide.bs.dropdown', function(e){ - console.log('Do something when the event fires'); + formDropdown.parentNode.addEventListener('hide.bs.dropdown', function(e){ + console.log('Do something when the event fires'); }, false); - formDropdown.parentNode.addEventListener('hidden.bs.dropdown', function(e){ - console.log('Do something when the event fires'); + formDropdown.parentNode.addEventListener('hidden.bs.dropdown', function(e){ + console.log('Do something when the event fires'); }, false); } }, false); @@ -1010,7 +1010,7 @@

    Examples

    Scrollspy

    The ScrollSpy component inherits some of the layout and other requirements from the original jQuery plugin in some cases, while in other cases a special markup is required. The component offers public methods, the specific original event, and can be used with JavaScript as well as via DATA API.

    The component will initialize for each element with data-spy="scroll" attribute, but will not work if the above requirements are not met or the anchors don't reference the containers accordingly.

    - +

    Options

    @@ -1056,22 +1056,22 @@

    .refresh()

    Events

    - - - - - - - - - - - - - +
    Event TypeDescription
    activate.bs.scrollspyThis event fires whenever a new item was activated by the component.
    + + + + + + + + + + + +
    Event TypeDescription
    activate.bs.scrollspyThis event fires whenever a new item was activated by the component.
    -

    The event target is the element we initialized the component via JavaScript or the data-spy="scroll" attribute. The newly activated menu item's link is the event.relatedTarget +

    The event target is the element we initialized the component via JavaScript or the data-spy="scroll" attribute. The newly activated menu item's link is the event.relatedTarget for the event.

    @@ -1163,12 +1163,12 @@
    Via DATA API

    Some additional styling can be used to force ScrollSpy containers to have the exact height as the sum of all child elements and / or child containers.

    /* element child containers */
    -section { 
    +section {
       position: relative; /* required */
       display: inline-block; width: 100%; /* not required, but recommended */
     }
     
    - +

    For instances of ScrollSpy when the designated element is not overflowing and the scroll target is the window (like the example with the side navigation of this page), the container nesting is, as you probably noticed, unlimited.

    Via JavaScript
    @@ -1187,9 +1187,9 @@
    Via JavaScript
    // alternativelly, provide a valid selector string // EG: ".my-unique-class-name" or "#my-unique-ID" - // in some cases the offset option would help calculate + // in some cases the offset option would help calculate // the correct boundaries of target containers - offset: 15 + offset: 15 })
    @@ -1228,7 +1228,7 @@
    Via JavaScript

    Examples

    According to the above Usage Guide let's initialize an overflowing element via DATA API:

    - +
    @@ -2847,7 +2847,7 @@

    This is another caption

    Affix

    The Affix component has it's own options and public method, but covers all the original events of the jQuery plugin. It inherits the same basic functionality as well as the CSS requirements to make it all work properly.

    - +

    Options

    @@ -2884,7 +2884,7 @@

    Options

    Using static values for offsetTop and / or offsetBottom would work best on non-responsive websites, or when the elements don't change their height when window resize occurs.

    - +

    Methods

    @@ -2894,7 +2894,7 @@

    .update()

    - +

    Events

    @@ -2934,7 +2934,7 @@

    Events

    - +

    Usage

    Required CSS
    @@ -2997,11 +2997,11 @@
    Via JavaScript
    var reasonableMargin = 20; var elementHeight = myAffix.offsetHeight; var footerHeight = document.getElementsByTagName('footer')[0].offsetHeight; - var maxScroll = Math.max( - document.body.scrollHeight, - document.body.offsetHeight, - document.documentElemnt.clientHeight, - document.documentElement.scrollHeight, + var maxScroll = Math.max( + document.body.scrollHeight, + document.body.offsetHeight, + document.documentElemnt.clientHeight, + document.documentElement.scrollHeight, document.documentElement.offsetHeight ); return maxScroll - elementHeight - footerHeight - reasonableMargin; }, @@ -3037,7 +3037,7 @@
    Via JavaScript
    - +

    Example

    We don't have a working example for this component in this section, due to the complexity and requirements, however the navigation on the right side of this page is a good example, it covers initialization via DATA API, the required styling and the original events.

    @@ -3084,7 +3084,7 @@

    Navigation

  • Events
  • Usage
  • Examples
  • - +
  • Tab diff --git a/lib/V3/modal-native.js b/lib/V3/modal-native.js index cf1200b6..ac79e4c0 100644 --- a/lib/V3/modal-native.js +++ b/lib/V3/modal-native.js @@ -18,8 +18,8 @@ var Modal = function(element, options) { // element can be the modal/triggering // determine modal, triggering element btnCheck = element[getAttribute](dataTarget)||element[getAttribute]('href'), checkModal = queryElement( btnCheck ), - modal = hasClass(element,component) ? element : checkModal; - + modal = hasClass(element,component) ? element : checkModal; + if ( hasClass(element, component) ) { element = null; } // modal is now independent of it's triggering element if ( !modal ) { return; } // invalidate @@ -30,6 +30,7 @@ var Modal = function(element, options) { // element can be the modal/triggering this[keyboard] = options[keyboard] === false || modal[getAttribute](dataKeyboard) === 'false' ? false : true; this[backdrop] = options[backdrop] === staticString || modal[getAttribute](databackdrop) === staticString ? staticString : true; this[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : this[backdrop]; + this[animation] = hasClass(modal, 'fade') ? true : false; this[content] = options[content]; // JavaScript only // bind, constants, event targets and other vars @@ -81,12 +82,12 @@ var Modal = function(element, options) { // element can be the modal/triggering }, createOverlay = function() { modalOverlay = 1; - + var newOverlay = DOC[createElement]('div'); overlay = queryElement('.'+modalBackdropString); if ( overlay === null ) { - newOverlay[setAttribute]('class',modalBackdropString+' fade'); + newOverlay[setAttribute]('class', modalBackdropString + (self[animation] ? ' fade' : '')); overlay = newOverlay; DOC[body][appendChild](overlay); } @@ -97,7 +98,7 @@ var Modal = function(element, options) { // element can be the modal/triggering modalOverlay = 0; DOC[body].removeChild(overlay); overlay = null; } - bootstrapCustomEvent.call(modal, hiddenEvent, component); + bootstrapCustomEvent.call(modal, hiddenEvent, component); }, keydownHandlerToggle = function() { if (hasClass(modal,inClass)) { @@ -131,12 +132,12 @@ var Modal = function(element, options) { // element can be the modal/triggering triggerHide = function() { modal[style].display = ''; element && (setFocus(element)); - + (function(){ if (!getElementsByClassName(DOC,component+' '+inClass)[0]) { resetScrollbar(); removeClass(DOC[body],component+'-open'); - overlay && hasClass(overlay,'fade') ? (removeClass(overlay,inClass), emulateTransitionEnd(overlay,removeOverlay)) + overlay && hasClass(overlay,'fade') ? (removeClass(overlay,inClass), emulateTransitionEnd(overlay,removeOverlay)) : removeOverlay(); resizeHandlerToggle(); diff --git a/lib/V4/modal-native.js b/lib/V4/modal-native.js index f4682610..cb90e2a8 100644 --- a/lib/V4/modal-native.js +++ b/lib/V4/modal-native.js @@ -18,8 +18,8 @@ var Modal = function(element, options) { // element can be the modal/triggering // determine modal, triggering element btnCheck = element[getAttribute](dataTarget)||element[getAttribute]('href'), checkModal = queryElement( btnCheck ), - modal = hasClass(element,component) ? element : checkModal; - + modal = hasClass(element,component) ? element : checkModal; + if ( hasClass(element, component) ) { element = null; } // modal is now independent of it's triggering element if ( !modal ) { return; } // invalidate @@ -30,6 +30,7 @@ var Modal = function(element, options) { // element can be the modal/triggering this[keyboard] = options[keyboard] === false || modal[getAttribute](dataKeyboard) === 'false' ? false : true; this[backdrop] = options[backdrop] === staticString || modal[getAttribute](databackdrop) === staticString ? staticString : true; this[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : this[backdrop]; + this[animation] = hasClass(modal, 'fade') ? true : false; this[content] = options[content]; // JavaScript only // bind, constants, event targets and other vars @@ -80,13 +81,13 @@ var Modal = function(element, options) { // element can be the modal/triggering scrollBarWidth = measureScrollbar(); }, createOverlay = function() { - modalOverlay = 1; - + modalOverlay = 1; + var newOverlay = DOC[createElement]('div'); overlay = queryElement('.'+modalBackdropString); if ( overlay === null ) { - newOverlay[setAttribute]('class',modalBackdropString+' fade'); + newOverlay[setAttribute]('class', modalBackdropString + (self[animation] ? ' fade' : '')); overlay = newOverlay; DOC[body][appendChild](overlay); } @@ -94,10 +95,10 @@ var Modal = function(element, options) { // element can be the modal/triggering removeOverlay = function() { overlay = queryElement('.'+modalBackdropString); if ( overlay && overlay !== null && typeof overlay === 'object' ) { - modalOverlay = 0; + modalOverlay = 0; DOC[body].removeChild(overlay); overlay = null; } - bootstrapCustomEvent.call(modal, hiddenEvent, component); + bootstrapCustomEvent.call(modal, hiddenEvent, component); }, keydownHandlerToggle = function() { if (hasClass(modal,showClass)) { @@ -131,12 +132,12 @@ var Modal = function(element, options) { // element can be the modal/triggering triggerHide = function() { modal[style].display = ''; element && (setFocus(element)); - + (function(){ if (!getElementsByClassName(DOC,component+' '+showClass)[0]) { resetScrollbar(); removeClass(DOC[body],component+'-open'); - overlay && hasClass(overlay,'fade') ? (removeClass(overlay,showClass), emulateTransitionEnd(overlay,removeOverlay)) + overlay && hasClass(overlay,'fade') ? (removeClass(overlay,showClass), emulateTransitionEnd(overlay,removeOverlay)) : removeOverlay(); resizeHandlerToggle(); @@ -191,7 +192,7 @@ var Modal = function(element, options) { // element can be the modal/triggering if ( overlay && modalOverlay && !hasClass(overlay,showClass)) { overlay[offsetWidth]; // force reflow to enable trasition - overlayDelay = getTransitionDurationFromElement(overlay); + overlayDelay = getTransitionDurationFromElement(overlay); addClass(overlay, showClass); } @@ -211,7 +212,7 @@ var Modal = function(element, options) { // element can be the modal/triggering this.hide = function() { bootstrapCustomEvent.call(modal, hideEvent, component); overlay = queryElement('.'+modalBackdropString); - overlayDelay = overlay && getTransitionDurationFromElement(overlay); + overlayDelay = overlay && getTransitionDurationFromElement(overlay); removeClass(modal,showClass); modal[setAttribute](ariaHidden, true);