diff --git a/dist/bootstrap-native.js b/dist/bootstrap-native.js index 2054dc37..981b8d63 100644 --- a/dist/bootstrap-native.js +++ b/dist/bootstrap-native.js @@ -554,7 +554,7 @@ // activate items on load var labelsToACtivate = getElementsByClassName(element, 'btn'), lbll = labelsToACtivate[length]; for (var i=0; i=0&&i[Ot]>=0&&i[Rt]<=(t[et]||e[V])&&i[qt]<=(t[tt]||e[Q])},he=function(){return{y:t.pageYOffset||e[J],x:t.pageXOffset||e[K]}},pe=function(t,e,i,o){var a=t[It](),l=o===n?he():{x:o[G]+o[K],y:o[Y]+o[J]},r={w:a[qt]-a[Ot],h:a[Rt]-a[zt]},c={w:e[Z],h:e[_]};i===zt?(e[Nt][zt]=a[zt]+l.y-c.h+"px",e[Nt][Ot]=a[Ot]+l.x-c.w/2+r.w/2+"px"):i===Rt?(e[Nt][zt]=a[zt]+l.y+r.h+"px",e[Nt][Ot]=a[Ot]+l.x-c.w/2+r.w/2+"px"):i===Ot?(e[Nt][zt]=a[zt]+l.y-c.h/2+r.h/2+"px",e[Nt][Ot]=a[Ot]+l.x-c.w+"px"):i===qt&&(e[Nt][zt]=a[zt]+l.y-c.h/2+r.h/2+"px",e[Nt][Ot]=a[Ot]+l.x+r.w+"px"),e.className[Et](i)===-1&&(e.className=e.className.replace(Gt,i))},ve=function(t){return t===zt?Rt:t===Rt?zt:t===Ot?qt:t===qt?Ot:t},me=function(i,o){i=ie(i),o=o||{};var a=i[yt](y),l=i[yt](N),c=i[yt](B),u="affix",s="affixed",f="function",d="update",h="affix-top",p="affixed-top",v="affix-bottom",m="affixed-bottom";if(this[O]=o[O]?ie(o[O]):ie(a)||null,this[Y]=o[Y]?o[Y]:parseInt(l)||0,this[F]=o[F]?o[F]:parseInt(c)||0,this[O]||this[Y]||this[F]){var g,b,x,T,w,C,I=this,A=Kt?50:500,L=!1,E=!1,k=function(){return Math.max(n[nt],n[_],e[V],e[nt],e[_])},M=function(){return null!==I[O]?I[O][It]()[zt]+T:I[Y]?parseInt(typeof I[Y]===f?I[Y]():I[Y]||0):void 0},H=function(){if(I[F])return x-i[_]-parseInt(typeof I[F]===f?I[F]():I[F]||0)},S=function(){x=k(),T=parseInt(he().y,0),g=M(),b=H(),w=parseInt(g)-T<0&&T>parseInt(g),C=parseInt(b)-T<0&&T>parseInt(b)},D=function(){L||te(i,u)||(ue.call(i,u,u),ue.call(i,h,u),Zt(i,u),L=!0,ue.call(i,s,u),ue.call(i,p,u))},P=function(){L&&te(i,u)&&(_t(i,u),L=!1)},$=function(){E||te(i,v)||(ue.call(i,u,u),ue.call(i,v,u),Zt(i,v),E=!0,ue.call(i,s,u),ue.call(i,m,u))},W=function(){E&&te(i,v)&&(_t(i,v),E=!1)},j=function(){C?(w&&P(),$()):(W(),w?D():P())};this[d]=function(){S(),j()},r in i||(ae(t,st,this[d]),ae(t,ut,function(){setTimeout(function(){I[d]()},A)})),i[r]=this,this[d]()}};se(r,me,e[At]("["+a+'="affix"]'));var ge=function(t){t=ie(t);var e=this,n="alert",i=oe(t,"."+n),a=function(){te(i,"fade")?ce(i,r):r()},l=function(a){i=oe(a[O],"."+n),t=ie("["+o+'="'+n+'"]',i),t&&i&&(t===a[O]||t.contains(a[O]))&&e.close()},r=function(){ue.call(i,mt,n),le(t,lt,l),i[kt].removeChild(i)};this.close=function(){i&&t&&te(i,Pt)&&(ue.call(i,vt,n),_t(i,Pt),i&&a())},c in t||ae(t,lt,l),t[c]=this};se(c,ge,e[At]("["+o+'="alert"]'));var be=function(t,e){t=ie(t),e=e||null;var n=!1,i="button",o="checked",a="reset",l="LABEL",r="INPUT",c=function(){e&&e!==a&&(e===jt&&(Zt(t,Wt),t[Tt](Wt,Wt)),t[Tt](L,t.innerHTML.replace(/^\s+|\s+$/g,"")),t.innerHTML=t[yt]("data-"+e+"-text"))},s=function(){t[yt](L)&&((te(t,Wt)||t[yt](Wt)===Wt)&&(_t(t,Wt),t.removeAttribute(Wt)),t.innerHTML=t[yt](L))},f=function(e){var a=e[O].tagName===l?e[O]:e[O][kt].tagName===l?e[O][kt]:null;if(a){var c=this,u=ne(c,"btn"),s=a[Ct](r)[0];if(s){if("checkbox"===s.type&&(s[o]?(_t(a,Bt),s[yt](o),s.removeAttribute(o),s[o]=!1):(Zt(a,Bt),s[yt](o),s[Tt](o,o),s[o]=!0),n||(n=!0,ue.call(s,xt,i),ue.call(t,xt,i))),"radio"===s.type&&!n&&!s[o]){Zt(a,Bt),s[Tt](o,o),s[o]=!0,ue.call(s,xt,i),ue.call(t,xt,i),n=!0;for(var f=0,d=u[Mt];ft||i===m-1&&0===t)&&(g=f[c]=qt),t<0?t=m-1:t===m&&(t=0),d=t,n=g===Ot?"next":"prev",ue.call(e,bt,l,v[t]),p=!0,clearInterval(h),S(t),Kt&&te(e,"slide")?(Zt(v[t],n),v[t][Z],Zt(v[t],g),Zt(v[i],g),re(v[i],Qt,function(o){var a=o[O]!==v[i]?1e3*o.elapsedTime:0;setTimeout(function(){p=!1,Zt(v[t],Bt),_t(v[i],Bt),_t(v[t],n),_t(v[t],g),_t(v[i],g),ue.call(e,gt,l,v[t]),f[q]&&!te(e,r)&&f.cycle()},a+100)})):(Zt(v[t],Bt),v[t][Z],_t(v[i],Bt),setTimeout(function(){p=!1,f[q]&&!te(e,r)&&f.cycle(),ue.call(e,gt,l,v[t])},100))}},this.getActiveIndex=function(){return v[Et](ne(e,"item active")[0])||0},s in e||(this[z]&&this[q]&&(ae(e,Ft[0],L),ae(e,Ft[1],E),ae(e,"touchstart",L),ae(e,"touchend",E)),w&&ae(w,lt,M),y&&ae(y,lt,M),I&&ae(I,lt,k,!1),this[$]===!0&&ae(t,ct,H,!1)),this.getActiveIndex()<0&&(v[Mt]&&Zt(v[0],Bt),A[Mt]&&S(0)),this[q]&&this.cycle(),e[s]=this};se(s,xe,e[At]("["+l+'="carousel"]'));var ye=function(t,e){t=ie(t),e=e||{};var n=null,o=null,a=this,l=!1,r=t[yt]("data-parent"),c="collapse",u="collapsed",s=function(t){ue.call(t,ft,c),l=!0,Zt(t,$t),_t(t,c),t[Nt][it]=t[nt]+"px",ce(t,function(){l=!1,t[Tt](ot,"true"),_t(t,$t),Zt(t,c),Zt(t,Pt),t[Nt][it]="",ue.call(t,dt,c)})},d=function(t){ue.call(t,ht,c),l=!0,t[Nt][it]=t[nt]+"px",_t(t,c),_t(t,Pt),Zt(t,$t),t[Z],t[Nt][it]="0px",ce(t,function(){l=!1,t[Tt](ot,"false"),_t(t,$t),Zt(t,c),t[Nt][it]="",ue.call(t,pt,c)})},h=function(){var e=t.href&&t[yt]("href"),n=t[yt](y),i=e||n&&fe.test(n)&&n;return i&&ie(i)};this.toggle=function(t){t.preventDefault(),l||(te(o,Pt)?a.hide():a.show())},this.hide=function(){d(o),Zt(t,u)},this.show=function(){if(n){var e=ie("."+c+"."+Pt,n),a=e&&(ie("["+i+'="'+c+'"]['+y+'="#'+e.id+'"]',n)||ie("["+i+'="'+c+'"][href="#'+e.id+'"]',n)),l=a&&(a[yt](y)||a.href);e&&a&&e!==o&&(d(e),l.split("#")[1]!==o.id?Zt(a,u):_t(a,u))}s(o),_t(t,u)},f in t||ae(t,lt,this.toggle),o=h(),n=ie(e.parent)||r&&oe(t,r),t[f]=this};se(f,ye,e[At]("["+i+'="collapse"]'));var Te=function(t,e){t=ie(t),this.persist=e===!0||"true"===t[yt]("data-persist")||!1;var n=this,o=!1,a=t[kt],l="dropdown",r="open",c=null,u=ie(".dropdown-menu",a),s=function(t){!o||27!=t.which&&27!=t.keyCode||(c=null,p())},f=function(e){var l=e[O],r=l&&(l[yt](i)||l[kt]&&yt in l[kt]&&l[kt][yt](i));if(l===t||l===a||l[kt]===t)e.preventDefault(),c=t,n.toggle();else if(o){if(l===u||u.contains(l)&&(n.persist||r))return;c=null,p()}(/\#$/.test(l.href)||l[kt]&&/\#$/.test(l[kt].href))&&e.preventDefault()},h=function(){ue.call(a,ft,l,c),Zt(a,r),u[Tt](ot,!0),ue.call(a,dt,l,c),ae(document,ct,s),o=!0},p=function(){ue.call(a,ht,l,c),_t(a,r),u[Tt](ot,!1),ue.call(a,pt,l,c),le(document,ct,s),o=!1};this.toggle=function(){te(a,r)&&o?p():h()},d in t||(u[Tt]("tabindex","0"),ae(document,lt,f)),t[d]=this};se(d,Te,e[At]("["+i+'="dropdown"]'));var we=function(i,a){i=ie(i);var l=i[yt](y)||i[yt]("href"),r=ie(l),c=te(i,"modal")?i:r,u="modal",s="static",f="paddingLeft",d="paddingRight",p="modal-backdrop";if(te(i,"modal")&&(i=null),c){a=a||{},this[$]=a[$]!==!1&&"false"!==c[yt](x),this[P]=a[P]!==s&&c[yt](b)!==s||s,this[P]=a[P]!==!1&&"false"!==c[yt](b)&&this[P],this[j]=a[j];var v,m,g,T,w=this,C=null,I=ne(e,Xt).concat(ne(e,Yt)),A=function(){var n=e[It]();return t[tt]||n[qt]-Math.abs(n[Ot])},L=function(){var e,i=n.currentStyle||t.getComputedStyle(n),o=parseInt(i[d],10);if(v&&(n[Nt][d]=o+g+"px",I[Mt]))for(var a=0;ae[V],g=k()},H=function(){c[Nt][f]=!v&&m?g+"px":"",c[Nt][d]=v&&!m?g+"px":""},S=function(){c[Nt][f]="",c[Nt][d]=""},D=function(){Jt=1;var t=document.createElement("div");T=ie("."+p),null===T&&(t[Tt]("class",p+" fade"),T=t,n.appendChild(T))},N=function(){T=ie("."+p),T&&null!==T&&"object"==typeof T&&(Jt=0,n.removeChild(T),T=null),ue.call(c,pt,u)},B=function(){te(c,Pt)?le(document,ct,X):ae(document,ct,X)},W=function(){te(c,Pt)?le(t,ut,w.update):ae(t,ut,w.update)},q=function(){te(c,Pt)?le(c,lt,Y):ae(c,lt,Y)},z=function(){Vt(c),ue.call(c,dt,u,C)},R=function(){W(),q(),B(),c[Nt].display="",i&&Vt(i),setTimeout(function(){ne(document,u+" "+Pt)[0]||(S(),E(),_t(n,u+"-open"),T&&te(T,"fade")?(_t(T,Pt),ce(T,N)):N())},50)},U=function(t){var e=t[O];e=e[wt](y)||e[wt]("href")?e:e[kt],e!==i||te(c,Pt)||(c.modalTrigger=i,C=i,w.show(),t.preventDefault())},X=function(t){var e=t.which||t.keyCode;w[$]&&27==e&&te(c,Pt)&&w.hide()},Y=function(t){var e=t[O];te(c,Pt)&&(e[kt][yt](o)===u||e[yt](o)===u||e===c&&w[P]!==s)&&(w.hide(),C=null,t.preventDefault())};this.toggle=function(){te(c,Pt)?this.hide():this.show()},this.show=function(){ue.call(c,ft,u,C);var t=ne(document,u+" in")[0];t&&t!==c&&t.modalTrigger[h].hide(),this[P]&&!Jt&&D(),T&&Jt&&!te(T,Pt)&&(T[Z],Zt(T,Pt)),setTimeout(function(){c[Nt].display="block",M(),L(),H(),W(),q(),B(),Zt(n,u+"-open"),Zt(c,Pt),c[Tt](at,!1),te(c,"fade")?ce(c,z):z()},Kt?150:0)},this.hide=function(){ue.call(c,ht,u),T=ie("."+p),_t(c,Pt),c[Tt](at,!0),setTimeout(function(){te(c,"fade")?ce(c,R):R()},Kt?150:0)},this.setContent=function(t){ie("."+u+"-content",c).innerHTML=t},this.update=function(){open&&(M(),L(),H())},!i||h in i||ae(i,lt,U),this[j]&&this.setContent(this[j]),!!i&&(i[h]=this)}};se(h,we,e[At]("["+i+'="modal"]'));var Ce=function(e,i){e=ie(e);var o=e[yt](k),a=e[yt](M),l=e[yt](S),r=e[yt](E),c=e[yt](D),u=e[yt](H),s="popover",f="template",d="trigger",h="class",v="div",m="fade",g="data-content",b="dismissible",x='',y=oe(e,".modal"),T=oe(e,"."+Xt),w=oe(e,"."+Yt);i=i||{},this[f]=i[f]?i[f]:null,this[d]=i[d]?i[d]:o||rt,this[R]=i[R]&&i[R]!==m?i[R]:a||m,this[U]=i[U]?i[U]:l||zt,this[W]=parseInt(i[W]||c)||200,this[b]=!(!i[b]&&"true"!==r),this[X]=ie(i[X])?ie(i[X]):ie(u)?ie(u):T?T:w?w:y?y:n;var C=this,A=e[yt](I)||null,L=e[yt](g)||null;if(L||this[f]){var N=null,B=0,P=this[U],$=function(t){null!==N&&t[O]===ie(".close",N)&&C.hide()},j=function(){C[X].removeChild(N),B=null,N=null},q=function(){if(A=e[yt](I),L=e[yt](g),N=document.createElement(v),null!==L&&null===C[f]){if(N[Tt]("role","tooltip"),null!==A){var t=document.createElement("h3");t[Tt](h,s+"-title"),t.innerHTML=C[b]?A+x:A,N.appendChild(t)}var n=document.createElement(v),i=document.createElement(v);n[Tt](h,"arrow"),i[Tt](h,s+"-content"),N.appendChild(n),N.appendChild(i),i.innerHTML=C[b]&&null===A?L+x:L}else{var o=document.createElement(v);o.innerHTML=C[f],N.innerHTML=o.firstChild.innerHTML}C[X].appendChild(N),N[Nt].display="block",N[Tt](h,s+" "+P+" "+C[R])},z=function(){!te(N,Pt)&&Zt(N,Pt)},Y=function(){pe(e,N,P,C[X]),de(N)||(P=ve(P),pe(e,N,P,C[X]))},F=function(){ue.call(e,dt,s)},G=function(){j(),ue.call(e,pt,s)};this.toggle=function(){null===N?C.show():C.hide()},this.show=function(){clearTimeout(B),B=setTimeout(function(){null===N&&(P=C[U],q(),Y(),z(),ue.call(e,ft,s),C[R]?ce(N,F):F())},20)},this.hide=function(){clearTimeout(B),B=setTimeout(function(){N&&null!==N&&te(N,Pt)&&(ue.call(e,ht,s),_t(N,Pt),C[R]?ce(N,G):G())},C[W])},p in e||(C[d]===rt?(ae(e,Ft[0],C.show),C[b]||ae(e,Ft[1],C.hide)):/^(click|focus)$/.test(C[d])&&(ae(e,C[d],C.toggle),C[b]||ae(e,"blur",C.hide)),C[b]&&ae(document,lt,$),!Ut&&ae(t,ut,C.hide)),e[p]=C}};se(p,Ce,e[At]("["+i+'="popover"]'));var Ie=function(e,n){e=ie(e);var i=ie(e[yt](y)),o=e[yt]("data-offset");if(n=n||{},n[O]||i){for(var a,l=n[O]&&ie(n[O])||i,r=l&&l[Ct]("A"),c=parseInt(o||n.offset)||10,u=[],s=[],f=e[_]=f&&h>a;if(!r&&p)"LI"!==n.tagName||te(n,Bt)||(Zt(n,Bt),r=!0,o&&!te(o,Bt)&&Zt(o,Bt),ue.call(e,"activate","scrollspy",u[t]));else if(p){if(!p&&!r||r&&p)return}else"LI"===n.tagName&&te(n,Bt)&&(_t(n,Bt),r=!1,o&&te(o,Bt)&&!ne(n[kt],Bt).length&&_t(o,Bt))},x=function(){a=d?he().y:e[J];for(var t=0,n=u[Mt];t1&&(t=e[e[Mt]-1]):t=e[0],t[Ct]("A")[0]},A=function(){return ie(I()[yt]("href"))},L=function(t){t.preventDefault(),c=t[O][yt](i)===o||fe.test(t[O][yt]("href"))?t[O]:t[O][kt],!g[r]&&!te(c[kt],Bt)&&v.show()};this.show=function(){c=c||t,f=ie(c[yt]("href")),u=I(),s=A(),g[r]=!0,_t(u[kt],Bt),Zt(c[kt],Bt),x&&(te(t[kt][kt],"dropdown-menu")?te(x,Bt)||Zt(x,Bt):te(x,Bt)&&_t(x,Bt)),ue.call(u,ht,o,c),te(s,"fade")?(_t(s,Pt),ce(s,C)):C()},m in t||ae(t,lt,L),this[a]&&(b=A()[kt]),t[m]=this}};se(m,Ae,e[At]("["+i+'="tab"]'));var Le=function(t,e){t=ie(t);var i=t[yt](M),o=t[yt](S),a=t[yt](D),l=t[yt](H),r="tooltip",c="class",u="title",s="fade",f="div",d=oe(t,".modal"),h=oe(t,"."+Xt),p=oe(t,"."+Yt);e=e||{},this[R]=e[R]&&e[R]!==s?e[R]:i||s,this[U]=e[U]?e[U]:o||zt,this[W]=parseInt(e[W]||a)||200,this[X]=ie(e[X])?ie(e[X]):ie(l)?ie(l):h?h:p?p:d?d:n;var v=this,m=0,b=this[U],x=null,y=t[yt](u)||t[yt](I)||t[yt](A);if(y&&""!=y){var T=function(){v[X].removeChild(x),x=null,m=null},w=function(){if(y=t[yt](u)||t[yt](I)||t[yt](A),!y||""==y)return!1;x=document.createElement(f),x[Tt]("role",r);var e=document.createElement(f),n=document.createElement(f);e[Tt](c,r+"-arrow"),n[Tt](c,r+"-inner"),x.appendChild(e),x.appendChild(n),n.innerHTML=y,v[X].appendChild(x),x[Tt](c,r+" "+b+" "+v[R])},C=function(){pe(t,x,b,v[X]),de(x)||(b=ve(b),pe(t,x,b,v[X]))},L=function(){!te(x,Pt)&&Zt(x,Pt)},E=function(){ue.call(t,dt,r)},k=function(){T(),ue.call(t,pt,r)};this.show=function(){clearTimeout(m),m=setTimeout(function(){if(null===x){if(b=v[U],0==w())return;C(),L(),ue.call(t,ft,r),v[R]?ce(x,E):E()}},20)},this.hide=function(){clearTimeout(m),m=setTimeout(function(){x&&null!==x&&te(x,Pt)&&(ue.call(t,ht,r),_t(x,Pt),v[R]?ce(x,k):k())},v[W])},this.toggle=function(){x?v.hide():v.show()},g in t||(t[Tt](A,y),t.removeAttribute(u),ae(t,Ft[0],this.show),ae(t,Ft[1],this.hide)),t[g]=this}};return se(g,Le,e[At]("["+i+'="tooltip"]')),{Affix:me,Alert:ge,Button:be,Carousel:xe,Collapse:ye,Dropdown:Te,Modal:we,Popover:Ce,ScrollSpy:Ie,Tab:Ae,Tooltip:Le}}); +!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.body,i="data-toggle",o="data-dismiss",a="data-spy",r="data-ride",c="Affix",u="Alert",s="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",D="data-placement",N="data-delay",B="data-offset-top",P="data-offset-bottom",$="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",ut="keydown",st="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="getBoundingClientRect",Lt="querySelectorAll",Et="getElementsByClassName",kt="indexOf",Mt="parentNode",Ht="length",St="toLowerCase",Dt="Transition",Nt="Webkit",Bt="style",Pt="active",$t="in",Wt="collapsing",jt="disabled",Ot="loading",qt="left",zt="right",Rt="top",Ut="bottom",Xt=!("opacity"in n[Bt]),Yt="navbar-fixed-top",Ft="navbar-fixed-bottom",Gt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Jt=/\b(top|bottom|left|top)+/,Kt=0,Qt=Nt+Dt in e[Bt]||Dt[St]()in e[Bt],Vt=Nt+Dt in e[Bt]?Nt[St]()+Dt+"End":Dt[St]()+"end",Zt=function(t){t.focus?t.focus():t.setActive()},_t=function(t,e){t.classList.add(e)},te=function(t,e){t.classList.remove(e)},ee=function(t,e){return t.classList.contains(e)},ne=function(t){for(var e=[],n=0,i=t[Ht];n=0&&i[qt]>=0&&i[Ut]<=(t[nt]||e[Z])&&i[zt]<=(t[et]||e[V])},pe=function(){return{y:t.pageYOffset||e[K],x:t.pageXOffset||e[Q]}},ve=function(t,e,i,o){var a=t[At](),l=o===n?pe():{x:o[J]+o[Q],y:o[F]+o[K]},r={w:a[zt]-a[qt],h:a[Ut]-a[Rt]},c={w:e[_],h:e[tt]};i===Rt?(e[Bt][Rt]=a[Rt]+l.y-c.h+"px",e[Bt][qt]=a[qt]+l.x-c.w/2+r.w/2+"px"):i===Ut?(e[Bt][Rt]=a[Rt]+l.y+r.h+"px",e[Bt][qt]=a[qt]+l.x-c.w/2+r.w/2+"px"):i===qt?(e[Bt][Rt]=a[Rt]+l.y-c.h/2+r.h/2+"px",e[Bt][qt]=a[qt]+l.x-c.w+"px"):i===zt&&(e[Bt][Rt]=a[Rt]+l.y-c.h/2+r.h/2+"px",e[Bt][qt]=a[qt]+l.x+r.w+"px"),e.className[kt](i)===-1&&(e.className=e.className.replace(Jt,i))},me=function(t){return t===Rt?Ut:t===Ut?Rt:t===qt?zt:t===zt?qt:t},ge=function(i,o){i=oe(i),o=o||{};var a=i[Tt](T),l=i[Tt](B),r=i[Tt](P),u="affix",s="affixed",f="function",d="update",h="affix-top",p="affixed-top",v="affix-bottom",m="affixed-bottom";if(this[q]=o[q]?oe(o[q]):oe(a)||null,this[F]=o[F]?o[F]:parseInt(l)||0,this[G]=o[G]?o[G]:parseInt(r)||0,this[q]||this[F]||this[G]){var g,b,x,y,w,C,I=this,A=Qt?50:500,L=!1,E=!1,k=function(){return Math.max(n[it],n[tt],e[Z],e[it],e[tt])},M=function(){return null!==I[q]?I[q][At]()[Rt]+y:I[F]?parseInt(typeof I[F]===f?I[F]():I[F]||0):void 0},H=function(){if(I[G])return x-i[tt]-parseInt(typeof I[G]===f?I[G]():I[G]||0)},S=function(){x=k(),y=parseInt(pe().y,0),g=M(),b=H(),w=parseInt(g)-y<0&&y>parseInt(g),C=parseInt(b)-y<0&&y>parseInt(b)},D=function(){L||ee(i,u)||(se.call(i,u,u),se.call(i,h,u),_t(i,u),L=!0,se.call(i,s,u),se.call(i,p,u))},N=function(){L&&ee(i,u)&&(te(i,u),L=!1)},$=function(){E||ee(i,v)||(se.call(i,u,u),se.call(i,v,u),_t(i,v),E=!0,se.call(i,s,u),se.call(i,m,u))},W=function(){E&&ee(i,v)&&(te(i,v),E=!1)},j=function(){C?(w&&N(),$()):(W(),w?D():N())};this[d]=function(){S(),j()},c in i||(le(t,ft,this[d]),le(t,st,function(){setTimeout(function(){I[d]()},A)})),i[c]=this,this[d]()}};fe(c,ge,e[Lt]("["+a+'="affix"]'));var be=function(t){t=oe(t);var e=this,n="alert",i=ae(t,"."+n),a=function(){ee(i,"fade")?ue(i,r):r()},l=function(a){i=ae(a[q],"."+n),t=oe("["+o+'="'+n+'"]',i),t&&i&&(t===a[q]||t.contains(a[q]))&&e.close()},r=function(){se.call(i,gt,n),re(t,rt,l),i[Mt].removeChild(i)};this.close=function(){i&&t&&ee(i,$t)&&(se.call(i,mt,n),te(i,$t),i&&a())},u in t||le(t,rt,l),t[u]=this};fe(u,be,e[Lt]("["+o+'="alert"]'));var xe=function(t,e){t=oe(t),e=e||null;var n=!1,i="button",o="checked",a="reset",r="LABEL",c="INPUT",u=function(){e&&e!==a&&(e===Ot&&(_t(t,jt),t[wt](jt,jt)),t[wt](E,t.innerHTML.replace(/^\s+|\s+$/g,"")),t.innerHTML=t[Tt]("data-"+e+"-text"))},f=function(){t[Tt](E)&&((ee(t,jt)||t[Tt](jt)===jt)&&(te(t,jt),t.removeAttribute(jt)),t.innerHTML=t[Tt](E))},d=function(e){var a=e[q].tagName===r?e[q]:e[q][Mt].tagName===r?e[q][Mt]:null;if(a){var l=this,u=ie(l,"btn"),s=a[It](c)[0];if(s){if("checkbox"===s.type&&(s[o]?(te(a,Pt),s[Tt](o),s.removeAttribute(o),s[o]=!1):(_t(a,Pt),s[Tt](o),s[wt](o,o),s[o]=!0),n||(n=!0,se.call(s,yt,i),se.call(t,yt,i))),"radio"===s.type&&!n&&!s[o]){_t(a,Pt),s[wt](o,o),s[o]=!0,se.call(s,yt,i),se.call(t,yt,i),n=!0;for(var f=0,d=u[Ht];ft||i===m-1&&0===t)&&(g=s[c]=zt),t<0?t=m-1:t===m&&(t=0),d=t,n=g===qt?"next":"prev",se.call(e,xt,l,v[t]),p=!0,clearInterval(h),S(t),Qt&&ee(e,"slide")?(_t(v[t],n),v[t][_],_t(v[t],g),_t(v[i],g),ce(v[i],Vt,function(o){var a=o[q]!==v[i]?1e3*o.elapsedTime:0;setTimeout(function(){p=!1,_t(v[t],Pt),te(v[i],Pt),te(v[t],n),te(v[t],g),te(v[i],g),se.call(e,bt,l,v[t]),s[z]&&!ee(e,r)&&s.cycle()},a+100)})):(_t(v[t],Pt),v[t][_],te(v[i],Pt),setTimeout(function(){p=!1,s[z]&&!ee(e,r)&&s.cycle(),se.call(e,bt,l,v[t])},100))}},this.getActiveIndex=function(){return v[kt](ie(e,"item active")[0])||0},f in e||(this[R]&&this[z]&&(le(e,Gt[0],L),le(e,Gt[1],E),le(e,"touchstart",L),le(e,"touchend",E)),T&&le(T,rt,M),x&&le(x,rt,M),C&&le(C,rt,k,!1),this[W]===!0&&le(t,ut,H,!1)),this.getActiveIndex()<0&&(v[Ht]&&_t(v[0],Pt),A[Ht]&&S(0)),this[z]&&this.cycle(),e[f]=this};fe(f,ye,e[Lt]("["+r+'="carousel"]'));var Te=function(t,e){t=oe(t),e=e||{};var n=null,o=null,a=this,l=!1,r=t[Tt]("data-parent"),c="collapse",u="collapsed",s=function(t){se.call(t,dt,c),l=!0,_t(t,Wt),te(t,c),t[Bt][ot]=t[it]+"px",ue(t,function(){l=!1,t[wt](at,"true"),te(t,Wt),_t(t,c),_t(t,$t),t[Bt][ot]="",se.call(t,ht,c)})},f=function(t){se.call(t,pt,c),l=!0,t[Bt][ot]=t[it]+"px",te(t,c),te(t,$t),_t(t,Wt),t[_],t[Bt][ot]="0px",ue(t,function(){l=!1,t[wt](at,"false"),te(t,Wt),_t(t,c),t[Bt][ot]="",se.call(t,vt,c)})},h=function(){var e=t.href&&t[Tt]("href"),n=t[Tt](T),i=e||n&&de.test(n)&&n;return i&&oe(i)};this.toggle=function(t){t.preventDefault(),l||(ee(o,$t)?a.hide():a.show())},this.hide=function(){f(o),_t(t,u)},this.show=function(){if(n){var e=oe("."+c+"."+$t,n),a=e&&(oe("["+i+'="'+c+'"]['+T+'="#'+e.id+'"]',n)||oe("["+i+'="'+c+'"][href="#'+e.id+'"]',n)),l=a&&(a[Tt](T)||a.href);e&&a&&e!==o&&(f(e),l.split("#")[1]!==o.id?_t(a,u):te(a,u))}s(o),te(t,u)},d in t||le(t,rt,this.toggle),o=h(),n=oe(e.parent)||r&&ae(t,r),t[d]=this};fe(d,Te,e[Lt]("["+i+'="collapse"]'));var we=function(t,e){t=oe(t),this.persist=e===!0||"true"===t[Tt]("data-persist")||!1;var n=this,o=!1,a=t[Mt],l="dropdown",r="open",c=null,u=oe(".dropdown-menu",a),s=function(t){!o||27!=t.which&&27!=t.keyCode||(c=null,p())},f=function(e){var l=e[q],r=l&&(l[Tt](i)||l[Mt]&&Tt in l[Mt]&&l[Mt][Tt](i));if(l===t||l===a||l[Mt]===t)e.preventDefault(),c=t,n.toggle();else if(o){if(l===u||u.contains(l)&&(n.persist||r))return;c=null,p()}(/\#$/.test(l.href)||l[Mt]&&/\#$/.test(l[Mt].href))&&e.preventDefault()},d=function(){se.call(a,dt,l,c),_t(a,r),u[wt](at,!0),se.call(a,ht,l,c),le(document,ut,s),o=!0},p=function(){se.call(a,pt,l,c),te(a,r),u[wt](at,!1),se.call(a,vt,l,c),re(document,ut,s),o=!1};this.toggle=function(){ee(a,r)&&o?p():d()},h in t||(u[wt]("tabindex","0"),le(document,rt,f)),t[h]=this};fe(h,we,e[Lt]("["+i+'="dropdown"]'));var Ce=function(i,a){i=oe(i);var l=i[Tt](T)||i[Tt]("href"),r=oe(l),c=ee(i,"modal")?i:r,u="modal",s="static",f="paddingLeft",d="paddingRight",h="modal-backdrop";if(ee(i,"modal")&&(i=null),c){a=a||{},this[W]=a[W]!==!1&&"false"!==c[Tt](y),this[$]=a[$]!==s&&c[Tt](x)!==s||s,this[$]=a[$]!==!1&&"false"!==c[Tt](x)&&this[$],this[O]=a[O];var v,m,g,b,w=this,C=null,I=ie(e,Yt).concat(ie(e,Ft)),A=function(){var n=e[At]();return t[et]||n[zt]-Math.abs(n[qt])},L=function(){var e,i=n.currentStyle||t.getComputedStyle(n),o=parseInt(i[d],10);if(v&&(n[Bt][d]=o+g+"px",I[Ht]))for(var a=0;ae[Z],g=k()},H=function(){c[Bt][f]=!v&&m?g+"px":"",c[Bt][d]=v&&!m?g+"px":""},S=function(){c[Bt][f]="",c[Bt][d]=""},D=function(){Kt=1;var t=document.createElement("div");b=oe("."+h),null===b&&(t[wt]("class",h+" fade"),b=t,n.appendChild(b))},N=function(){b=oe("."+h),b&&null!==b&&"object"==typeof b&&(Kt=0,n.removeChild(b),b=null),se.call(c,vt,u)},B=function(){ee(c,$t)?re(document,ut,X):le(document,ut,X)},P=function(){ee(c,$t)?re(t,st,w.update):le(t,st,w.update)},j=function(){ee(c,$t)?re(c,rt,Y):le(c,rt,Y)},z=function(){Zt(c),se.call(c,ht,u,C)},R=function(){P(),j(),B(),c[Bt].display="",i&&Zt(i),setTimeout(function(){ie(document,u+" "+$t)[0]||(S(),E(),te(n,u+"-open"),b&&ee(b,"fade")?(te(b,$t),ue(b,N)):N())},50)},U=function(t){var e=t[q];e=e[Ct](T)||e[Ct]("href")?e:e[Mt],e!==i||ee(c,$t)||(c.modalTrigger=i,C=i,w.show(),t.preventDefault())},X=function(t){var e=t.which||t.keyCode;w[W]&&27==e&&ee(c,$t)&&w.hide()},Y=function(t){var e=t[q];ee(c,$t)&&(e[Mt][Tt](o)===u||e[Tt](o)===u||e===c&&w[$]!==s)&&(w.hide(),C=null,t.preventDefault())};this.toggle=function(){ee(c,$t)?this.hide():this.show()},this.show=function(){se.call(c,dt,u,C);var t=ie(document,u+" in")[0];t&&t!==c&&t.modalTrigger[p].hide(),this[$]&&!Kt&&D(),b&&Kt&&!ee(b,$t)&&(b[_],_t(b,$t)),setTimeout(function(){c[Bt].display="block",M(),L(),H(),P(),j(),B(),_t(n,u+"-open"),_t(c,$t),c[wt](lt,!1),ee(c,"fade")?ue(c,z):z()},Qt?150:0)},this.hide=function(){se.call(c,pt,u),b=oe("."+h),te(c,$t),c[wt](lt,!0),setTimeout(function(){ee(c,"fade")?ue(c,R):R()},Qt?150:0)},this.setContent=function(t){oe("."+u+"-content",c).innerHTML=t},this.update=function(){open&&(M(),L(),H())},!i||p in i||le(i,rt,U),this[O]&&this.setContent(this[O]),!!i&&(i[p]=this)}};fe(p,Ce,e[Lt]("["+i+'="modal"]'));var Ie=function(e,i){e=oe(e);var o=e[Tt](M),a=e[Tt](H),l=e[Tt](D),r=e[Tt](k),c=e[Tt](N),u=e[Tt](S),s="popover",f="template",d="trigger",h="class",p="div",m="fade",g="data-content",b="dismissible",x='',y=ae(e,".modal"),T=ae(e,"."+Yt),w=ae(e,"."+Ft);i=i||{},this[f]=i[f]?i[f]:null,this[d]=i[d]?i[d]:o||ct,this[U]=i[U]&&i[U]!==m?i[U]:a||m,this[X]=i[X]?i[X]:l||Rt,this[j]=parseInt(i[j]||c)||200,this[b]=!(!i[b]&&"true"!==r),this[Y]=oe(i[Y])?oe(i[Y]):oe(u)?oe(u):T?T:w?w:y?y:n;var C=this,I=e[Tt](A)||null,L=e[Tt](g)||null;if(L||this[f]){var E=null,B=0,P=this[X],$=function(t){null!==E&&t[q]===oe(".close",E)&&C.hide()},W=function(){C[Y].removeChild(E),B=null,E=null},O=function(){if(I=e[Tt](A),L=e[Tt](g),E=document.createElement(p),null!==L&&null===C[f]){if(E[wt]("role","tooltip"),null!==I){var t=document.createElement("h3");t[wt](h,s+"-title"),t.innerHTML=C[b]?I+x:I,E.appendChild(t)}var n=document.createElement(p),i=document.createElement(p);n[wt](h,"arrow"),i[wt](h,s+"-content"),E.appendChild(n),E.appendChild(i),i.innerHTML=C[b]&&null===I?L+x:L}else{var o=document.createElement(p);o.innerHTML=C[f],E.innerHTML=o.firstChild.innerHTML}C[Y].appendChild(E),E[Bt].display="block",E[wt](h,s+" "+P+" "+C[U])},z=function(){!ee(E,$t)&&_t(E,$t)},R=function(){ve(e,E,P,C[Y]),he(E)||(P=me(P),ve(e,E,P,C[Y]))},F=function(){se.call(e,ht,s)},G=function(){W(),se.call(e,vt,s)};this.toggle=function(){null===E?C.show():C.hide()},this.show=function(){clearTimeout(B),B=setTimeout(function(){null===E&&(P=C[X],O(),R(),z(),se.call(e,dt,s),C[U]?ue(E,F):F())},20)},this.hide=function(){clearTimeout(B),B=setTimeout(function(){E&&null!==E&&ee(E,$t)&&(se.call(e,pt,s),te(E,$t),C[U]?ue(E,G):G())},C[j])},v in e||(C[d]===ct?(le(e,Gt[0],C.show),C[b]||le(e,Gt[1],C.hide)):/^(click|focus)$/.test(C[d])&&(le(e,C[d],C.toggle),C[b]||le(e,"blur",C.hide)),C[b]&&le(document,rt,$),!Xt&&le(t,st,C.hide)),e[v]=C}};fe(v,Ie,e[Lt]("["+i+'="popover"]'));var Ae=function(e,n){e=oe(e);var i=oe(e[Tt](T)),o=e[Tt]("data-offset");if(n=n||{},n[q]||i){for(var a,l=n[q]&&oe(n[q])||i,r=l&&l[It]("A"),c=parseInt(o||n.offset)||10,u=[],s=[],f=e[tt]=f&&h>a;if(!r&&p)"LI"!==n.tagName||ee(n,Pt)||(_t(n,Pt),r=!0,o&&!ee(o,Pt)&&_t(o,Pt),se.call(e,"activate","scrollspy",u[t]));else if(p){if(!p&&!r||r&&p)return}else"LI"===n.tagName&&ee(n,Pt)&&(te(n,Pt),r=!1,o&&ee(o,Pt)&&!ie(n[Mt],Pt).length&&te(o,Pt))},x=function(){a=d?pe().y:e[K];for(var t=0,n=u[Ht];t1&&(t=e[e[Ht]-1]):t=e[0],t[It]("A")[0]},A=function(){return oe(I()[Tt]("href"))},L=function(t){t.preventDefault(),c=t[q][Tt](i)===o||de.test(t[q][Tt]("href"))?t[q]:t[q][Mt],!m[r]&&!ee(c[Mt],Pt)&&v.show()};this.show=function(){c=c||t,f=oe(c[Tt]("href")),u=I(),s=A(),m[r]=!0,te(u[Mt],Pt),_t(c[Mt],Pt),x&&(ee(t[Mt][Mt],"dropdown-menu")?ee(x,Pt)||_t(x,Pt):ee(x,Pt)&&te(x,Pt)),se.call(u,pt,o,c),ee(s,"fade")?(te(s,$t),ue(s,w)):w()},g in t||le(t,rt,L),this[a]&&(b=A()[Mt]),t[g]=this}};fe(g,Le,e[Lt]("["+i+'="tab"]'));var Ee=function(t,e){t=oe(t);var i=t[Tt](H),o=t[Tt](D),a=t[Tt](N),l=t[Tt](S),r="tooltip",c="class",u="title",s="fade",f="div",d=ae(t,".modal"),h=ae(t,"."+Yt),p=ae(t,"."+Ft);e=e||{},this[U]=e[U]&&e[U]!==s?e[U]:i||s,this[X]=e[X]?e[X]:o||Rt,this[j]=parseInt(e[j]||a)||200,this[Y]=oe(e[Y])?oe(e[Y]):oe(l)?oe(l):h?h:p?p:d?d:n;var v=this,m=0,g=this[X],x=null,y=t[Tt](u)||t[Tt](A)||t[Tt](L);if(y&&""!=y){var T=function(){v[Y].removeChild(x),x=null,m=null},w=function(){if(y=t[Tt](u)||t[Tt](A)||t[Tt](L),!y||""==y)return!1;x=document.createElement(f),x[wt]("role",r);var e=document.createElement(f),n=document.createElement(f);e[wt](c,r+"-arrow"),n[wt](c,r+"-inner"),x.appendChild(e),x.appendChild(n),n.innerHTML=y,v[Y].appendChild(x),x[wt](c,r+" "+g+" "+v[U])},C=function(){ve(t,x,g,v[Y]),he(x)||(g=me(g),ve(t,x,g,v[Y]))},I=function(){!ee(x,$t)&&_t(x,$t)},E=function(){se.call(t,ht,r)},k=function(){T(),se.call(t,vt,r)};this.show=function(){clearTimeout(m),m=setTimeout(function(){if(null===x){if(g=v[X],0==w())return;C(),I(),se.call(t,dt,r),v[U]?ue(x,E):E()}},20)},this.hide=function(){clearTimeout(m),m=setTimeout(function(){x&&null!==x&&ee(x,$t)&&(se.call(t,pt,r),te(x,$t),v[U]?ue(x,k):k())},v[j])},this.toggle=function(){x?v.hide():v.show()},b in t||(t[wt](L,y),t.removeAttribute(u),le(t,Gt[0],this.show),le(t,Gt[1],this.hide)),t[b]=this}};return fe(b,Ee,e[Lt]("["+i+'="tooltip"]')),{Affix:ge,Alert:be,Button:xe,Carousel:ye,Collapse:Te,Dropdown:we,Modal:Ce,Popover:Ie,ScrollSpy:Ae,Tab:Le,Tooltip:Ee}}); diff --git a/lib/V3/button-native.js b/lib/V3/button-native.js index 4d45e80f..7fd2e0d7 100644 --- a/lib/V3/button-native.js +++ b/lib/V3/button-native.js @@ -112,7 +112,7 @@ var Button = function( element, option ) { // activate items on load var labelsToACtivate = getElementsByClassName(element, 'btn'), lbll = labelsToACtivate[length]; for (var i=0; i