bootstrap.native
Advanced tools
Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "bootstrap.native", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"homepage": "http://thednp.github.io/bootstrap.native/", | ||
@@ -8,3 +8,3 @@ "authors": [ | ||
], | ||
"description": "Native Javascript for Bootstrap 3, the sweetest Javascript library without jQuery.", | ||
"description": "Native Javascript for Bootstrap, the sweetest Javascript library without jQuery.", | ||
"main": "dist/bootstrap-native.js", | ||
@@ -11,0 +11,0 @@ "moduleType": [ |
@@ -13,2 +13,3 @@ #!/usr/bin/env node | ||
var license = pack.license + '-License'; | ||
var libPath = __dirname + '/lib'; | ||
// Parse arguments: | ||
@@ -46,3 +47,3 @@ var argv = require('yargs') | ||
// Get a list of all modules: | ||
var allModules = fs.readdirSync('lib/V4').filter(item => /-native\.js$/.test(item)); | ||
var allModules = fs.readdirSync(`${libPath}/V4`).filter(item => /-native\.js$/.test(item)); | ||
@@ -90,3 +91,3 @@ // Get a list of modules to include: | ||
promises[i] = new Promise(function (resolve, reject) { | ||
fs.readFile(`lib/V4/${name.toLowerCase()}-native.js`, 'utf8', function (err, contents) { | ||
fs.readFile(`${libPath}/V4/${name.toLowerCase()}-native.js`, 'utf8', function (err, contents) { | ||
if (err) reject(err); | ||
@@ -114,3 +115,3 @@ resolve(contents); | ||
function wrap(main) { | ||
var utils = fs.readFileSync('lib/V4/utils.js', 'utf8').split('\n').join('\n '); // Indentation | ||
var utils = fs.readFileSync(`${libPath}/V4/utils.js`, 'utf8').split('\n').join('\n '); // Indentation | ||
main = main.split('\n').join('\n '); // Indentation | ||
@@ -117,0 +118,0 @@ // Initialize arrays: |
@@ -13,2 +13,3 @@ #!/usr/bin/env node | ||
var license = pack.license + '-License'; | ||
var libPath = __dirname + '/lib'; | ||
// Parse arguments: | ||
@@ -46,3 +47,3 @@ var argv = require('yargs') | ||
// Get a list of all modules: | ||
var allModules = fs.readdirSync('lib/V3/').filter(item => /-native\.js$/.test(item)); | ||
var allModules = fs.readdirSync(`${libPath}/V3/`).filter(item => /-native\.js$/.test(item)); | ||
@@ -90,3 +91,3 @@ // Get a list of modules to include: | ||
promises[i] = new Promise(function (resolve, reject) { | ||
fs.readFile(`lib/V3/${name.toLowerCase()}-native.js`, 'utf8', function (err, contents) { | ||
fs.readFile(`${libPath}/V3/${name.toLowerCase()}-native.js`, 'utf8', function (err, contents) { | ||
if (err) reject(err); | ||
@@ -114,3 +115,3 @@ resolve(contents); | ||
function wrap(main) { | ||
var utils = fs.readFileSync('lib/V3/utils.js', 'utf8').split('\n').join('\n '); // Indentation | ||
var utils = fs.readFileSync(`${libPath}/V3/utils.js`, 'utf8').split('\n').join('\n '); // Indentation | ||
main = main.split('\n').join('\n '); // Indentation | ||
@@ -117,0 +118,0 @@ // Initialize arrays: |
@@ -1,2 +0,2 @@ | ||
// Native Javascript for Bootstrap 4 v2.0.3 | © dnp_theme | MIT-License | ||
// Native Javascript for Bootstrap 4 v2.0.4 | © dnp_theme | MIT-License | ||
(function (root, factory) { | ||
@@ -31,5 +31,2 @@ if (typeof define === 'function' && define.amd) { | ||
doc = document.documentElement, body = document.body, | ||
// IE browser detect | ||
isIE = (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) ? parseFloat( RegExp.$1 ) : false, | ||
@@ -57,3 +54,2 @@ // function toggle attributes | ||
dataKeyboard = 'data-keyboard', | ||
dataDuration = 'data-duration', | ||
dataTarget = 'data-target', | ||
@@ -76,3 +72,3 @@ dataInterval = 'data-interval', | ||
backdrop = 'backdrop', keyboard = 'keyboard', delay = 'delay', | ||
duration = 'duration', content = 'content', target = 'target', | ||
content = 'content', target = 'target', | ||
interval = 'interval', pause = 'pause', animation = 'animation', | ||
@@ -112,12 +108,16 @@ placement = 'placement', container = 'container', | ||
// other | ||
getAttribute = 'getAttribute', | ||
setAttribute = 'setAttribute', | ||
hasAttribute = 'hasAttribute', | ||
getElementsByTagName = 'getElementsByTagName', | ||
getBoundingClientRect= 'getBoundingClientRect', | ||
getElementsByCLASSNAME = 'getElementsByClassName', | ||
getAttribute = 'getAttribute', | ||
setAttribute = 'setAttribute', | ||
hasAttribute = 'hasAttribute', | ||
getElementsByTagName = 'getElementsByTagName', | ||
getBoundingClientRect = 'getBoundingClientRect', | ||
getElementsByCLASSNAME = 'getElementsByClassName', | ||
indexOf = 'indexOf', | ||
parentNode = 'parentNode', | ||
length = 'length', | ||
indexOf = 'indexOf', | ||
parentNode = 'parentNode', | ||
length = 'length', | ||
toLowerCase = 'toLowerCase', | ||
Transition = 'Transition', | ||
Webkit = 'Webkit', | ||
style = 'style', | ||
@@ -138,2 +138,6 @@ active = 'active', | ||
// transitionEnd since 2.0.4 | ||
supportTransitions = Webkit+Transition in doc[style] || Transition[toLowerCase]() in doc[style], | ||
transitionEndEvent = Webkit+Transition in doc[style] ? Webkit[toLowerCase]()+Transition+'End' : Transition[toLowerCase]()+'end', | ||
// set new focus element since 2.0.3 | ||
@@ -184,2 +188,12 @@ setFocus = function(element){ | ||
}, | ||
one = function (element, event, handler) { // one since 2.0.4 | ||
on(element, event, function handlerWrapper(){ | ||
handler(); | ||
off(element, event, handlerWrapper); | ||
}); | ||
}, | ||
emulateTransitionEnd = function(element,handler){ // emulateTransitionEnd since 2.0.4 | ||
if (supportTransitions) { one(element,transitionEndEvent, handler); } | ||
else { handler(); } | ||
}, | ||
bootstrapCustomEvent = function (eventName, componentName, related) { | ||
@@ -208,8 +222,7 @@ var OriginalCustomEvent = new CustomEvent( eventName + '.bs.' + componentName); | ||
getOuterHeight = function (child) { | ||
// the getComputedStyle polyfill would do this for us, but we want to make sure it does | ||
var style = child && (child.currentStyle || globalObject.getComputedStyle(child)), | ||
btp = /px/.test(style.borderTopWidth) ? Math.round(style.borderTopWidth.replace('px','')) : 0, | ||
btb = /px/.test(style.borderBottomWidth) ? Math.round(style.borderBottomWidth.replace('px','')) : 0, | ||
mtp = /px/.test(style.marginTop) ? Math.round(style.marginTop.replace('px','')) : 0, | ||
mbp = /px/.test(style.marginBottom) ? Math.round(style.marginBottom.replace('px','')) : 0; | ||
var childStyle = child && globalObject.getComputedStyle(child), | ||
btp = /px/.test(childStyle.borderTopWidth) ? Math.round(childStyle.borderTopWidth.replace('px','')) : 0, | ||
btb = /px/.test(childStyle.borderBottomWidth) ? Math.round(childStyle.borderBottomWidth.replace('px','')) : 0, | ||
mtp = /px/.test(childStyle.marginTop) ? Math.round(childStyle.marginTop.replace('px','')) : 0, | ||
mbp = /px/.test(childStyle.marginBottom) ? Math.round(childStyle.marginBottom.replace('px','')) : 0; | ||
return child[clientHeight] + parseInt( btp ) + parseInt( btb ) + parseInt( mtp ) + parseInt( mbp ); | ||
@@ -246,16 +259,16 @@ }, | ||
if ( position === top ) { // TOP | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
} else if ( position === bottom ) { // BOTTOM | ||
element.style[top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
element[style][top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
} else if ( position === left ) { // LEFT | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w + 'px'; | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w + 'px'; | ||
} else if ( position === right ) { // RIGHT | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element.style[left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
} | ||
@@ -285,4 +298,4 @@ element.className[indexOf](position) === -1 && (element.className = element.className.replace(tipPositions,position)); | ||
var self = this, component = 'alert', | ||
alert = getClosest(element,'.'+component), duration = (isIE && isIE < 10) ? 0 : 300, // default alert transition duration | ||
// handler | ||
alert = getClosest(element,'.'+component), | ||
// handlers | ||
clickHandler = function(e){ | ||
@@ -296,2 +309,7 @@ var eventTarget = e[target]; | ||
} | ||
}, | ||
transitionEndHandler = function(){ | ||
bootstrapCustomEvent.call(alert, closedEvent, component); | ||
off(element, clickEvent, clickHandler); // detach it's listener | ||
alert[parentNode].removeChild(alert); | ||
}; | ||
@@ -304,9 +322,5 @@ | ||
removeClass(alert,showClass); | ||
setTimeout(function() { | ||
if (alert) { | ||
bootstrapCustomEvent.call(alert, closedEvent, component); | ||
off(element, clickEvent, clickHandler); // detach it's listener | ||
alert[parentNode].removeChild(alert); | ||
} | ||
}, duration); | ||
if (alert) { | ||
emulateTransitionEnd(alert,transitionEndHandler); | ||
} | ||
} | ||
@@ -435,3 +449,2 @@ }; | ||
keyboardData = element[getAttribute](dataKeyboard) === 'true' || false, | ||
durationData = parseInt(element[getAttribute](dataDuration)) || 600, // bootstrap carousel default transition duration | ||
@@ -447,3 +460,2 @@ // strings | ||
this[pause] = (options[pause] === hoverEvent || pauseData) ? hoverEvent : false; // false / hover | ||
this[duration] = (isIE && isIE < 10) ? 0 : options[duration] || durationData; | ||
@@ -458,3 +470,3 @@ if ( !( options[interval] || intervalData ) ) { // determine slide interval | ||
var self = this, index = element.index = 0, timer = element.timer = 0, | ||
isSliding = false, // isSliding prevents click event handlers when animation is running | ||
isSliding = this.isSliding = false, // isSliding prevents click event handlers when animation is running | ||
slides = getElementsByClassName(element,carouselItem), total = slides[length], | ||
@@ -568,11 +580,11 @@ slideDirection = this[direction] = left, | ||
var activeItem = this.getActiveIndex(), // the current active | ||
orientation = slideDirection === left ? 'next' : 'prev'; //determine type | ||
orientation = slideDirection === left ? 'next' : 'prev'; //determine type | ||
bootstrapCustomEvent.call(element, slideEvent, component, slides[next]); // here we go with the slide | ||
isSliding = true; | ||
isSliding = this.isSliding = true; | ||
clearInterval(timer); | ||
setActivePage( next ); | ||
if ( hasClass(element,'slide') && !(isIE && isIE < 10) ) { | ||
if ( supportTransitions && hasClass(element,'slide') ) { | ||
addClass(slides[next],carouselItem +'-'+ orientation); | ||
@@ -583,4 +595,4 @@ slides[next][offsetWidth]; | ||
setTimeout(function() { //we're gonna fake waiting for the animation to finish, cleaner and better | ||
isSliding = false; | ||
one(slides[next], transitionEndEvent, function(){ | ||
isSliding = self.isSliding = false; | ||
@@ -598,4 +610,4 @@ addClass(slides[next],active); | ||
bootstrapCustomEvent.call(element, slidEvent, component, slides[next]); // here we go with the slid event | ||
}); | ||
}, this[duration] + 100 ); | ||
} else { | ||
@@ -611,3 +623,3 @@ addClass(slides[next],active); | ||
bootstrapCustomEvent.call(element, slidEvent, component, slides[next]); // here we go with the slid event | ||
}, this[duration] + 100 ); | ||
}, 100 ); | ||
} | ||
@@ -634,3 +646,2 @@ }; | ||
this[keyboard] === true && on( globalObject, keydownEvent, keyHandler, false); | ||
} | ||
@@ -663,5 +674,3 @@ if (this.getActiveIndex()<0) { | ||
options = options || {}; | ||
options.duration = parseInt(options.duration || element[getAttribute](dataDuration)); | ||
this[duration] = (isIE && isIE < 10) ? 0 : (options.duration || 300); // default collapse transition duration | ||
@@ -681,17 +690,15 @@ // event targets and constants | ||
isAnimating = true; | ||
removeClass(collapseElement,component); | ||
addClass(collapseElement,collapsing); | ||
collapseElement.style[height] = '0px'; | ||
addClass(collapseElement,showClass); | ||
setTimeout(function() { | ||
collapseElement.style[height] = getMaxHeight(collapseElement) + 'px'; | ||
}, 10); | ||
setTimeout(function() { | ||
collapseElement[style][height] = getMaxHeight(collapseElement) + 'px'; | ||
}, 0); | ||
emulateTransitionEnd(collapseElement, function(){ | ||
removeClass(collapseElement,collapsing); | ||
addClass(collapseElement,component); | ||
addClass(collapseElement,showClass); | ||
collapseElement.style[height] = ''; | ||
collapseElement[style][height] = ''; | ||
isAnimating = false; | ||
collapseElement[setAttribute](ariaExpanded,'true'); | ||
bootstrapCustomEvent.call(collapseElement, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
}, | ||
@@ -701,17 +708,16 @@ closeAction = function(collapseElement) { | ||
isAnimating = true; | ||
removeClass(collapseElement,component); | ||
collapseElement.style[height] = getMaxHeight(collapseElement) + 'px'; | ||
collapseElement[style][height] = getMaxHeight(collapseElement) + 'px'; | ||
setTimeout(function() { | ||
addClass(collapseElement,collapsing); | ||
collapseElement.style[height] = '0px'; | ||
}, 10); | ||
setTimeout(function() { | ||
collapseElement[style][height] = '0px'; | ||
}, 0); | ||
emulateTransitionEnd(collapseElement, function(){ | ||
removeClass(collapseElement,collapsing); | ||
removeClass(collapseElement,showClass); | ||
addClass(collapseElement,component); | ||
collapseElement.style[height] = ''; | ||
collapseElement[style][height] = ''; | ||
isAnimating = false; | ||
collapseElement[setAttribute](ariaExpanded,'false'); | ||
bootstrapCustomEvent.call(collapseElement, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
}, | ||
@@ -789,4 +795,3 @@ getTarget = function() { | ||
var eventTarget = e[target], hasData; | ||
if (!eventTarget || !eventTarget[parentNode]) return; // invalidate | ||
hasData = eventTarget[getAttribute](dataToggle) || eventTarget[parentNode][getAttribute](dataToggle); | ||
hasData = ( eventTarget.nodeType !== 1 && (eventTarget[getAttribute](dataToggle) || eventTarget[parentNode][getAttribute](dataToggle)) ); | ||
if ( eventTarget === element || eventTarget === parent || eventTarget[parentNode] === element ) { | ||
@@ -801,3 +806,3 @@ e.preventDefault(); // comment this line to stop preventing navigation when click target is a link | ||
} | ||
(/\#$/.test(eventTarget.href) || /\#$/.test(eventTarget[parentNode].href)) && e.preventDefault(); // should be here to prevent jumps | ||
(/\#$/.test(eventTarget.href) || eventTarget[parentNode] && /\#$/.test(eventTarget[parentNode].href)) && e.preventDefault(); // should be here to prevent jumps | ||
}, | ||
@@ -873,3 +878,2 @@ // private methods | ||
this[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : this[backdrop]; | ||
this[duration] = (isIE && isIE < 10) ? 50 : (options[duration] || parseInt(modal[getAttribute](dataDuration)) || 300); // the default modal fade duration option | ||
this[content] = options[content]; // JavaScript only | ||
@@ -888,6 +892,6 @@ | ||
var bodyStyle = body.currentStyle || globalObject.getComputedStyle(body), bodyPad = parseInt((bodyStyle[paddingRight]), 10); | ||
if (bodyIsOverflowing) { body.style[paddingRight] = (bodyPad + scrollbarWidth) + 'px'; } | ||
if (bodyIsOverflowing) { body[style][paddingRight] = (bodyPad + scrollbarWidth) + 'px'; } | ||
}, | ||
resetScrollbar = function () { | ||
body.style[paddingRight] = ''; | ||
body[style][paddingRight] = ''; | ||
}, | ||
@@ -908,8 +912,8 @@ measureScrollbar = function () { // thx walsh | ||
adjustDialog = function () { | ||
modal.style[paddingLeft] = !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal.style[paddingRight] = bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal[style][paddingLeft] = !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal[style][paddingRight] = bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
}, | ||
resetAdjustments = function () { | ||
modal.style[paddingLeft] = ''; | ||
modal.style[paddingRight] = ''; | ||
modal[style][paddingLeft] = ''; | ||
modal[style][paddingRight] = ''; | ||
}, | ||
@@ -987,4 +991,5 @@ createOverlay = function() { | ||
var currentOpen = getElementsByClassName(document,component+' in')[0]; | ||
currentOpen && currentOpen !== modal && currentOpen.modalTrigger[stringModal].hide(); // we elegantly hide any opened modal | ||
// we elegantly hide any opened modal | ||
var currentOpen = getElementsByClassName(document,component+' '+showClass)[0]; | ||
currentOpen && currentOpen !== modal && currentOpen.modalTrigger[stringModal].hide(); | ||
@@ -1000,3 +1005,3 @@ if ( this[backdrop] ) { | ||
setTimeout( function() { | ||
modal.style.display = 'block'; | ||
modal[style].display = 'block'; | ||
@@ -1014,8 +1019,9 @@ checkScrollbar(); | ||
modal[setAttribute](ariaHidden, false); | ||
}, this[duration]/2); | ||
setTimeout( function() { | ||
}, 0); | ||
emulateTransitionEnd(modal,function(){ | ||
open = self.open = true; | ||
setFocus(modal); | ||
bootstrapCustomEvent.call(modal, shownEvent, component, relatedTarget); | ||
}, this[duration]); | ||
}); | ||
}; | ||
@@ -1032,5 +1038,4 @@ this.hide = function() { | ||
setTimeout( function() { | ||
emulateTransitionEnd(modal, function(){ | ||
removeClass(body,component+'-open'); | ||
resizeHandlerToggle(); | ||
@@ -1042,6 +1047,4 @@ dismissHandlerToggle(); | ||
resetScrollbar(); | ||
modal.style.display = ''; | ||
}, this[duration]/2); | ||
modal[style].display = ''; | ||
setTimeout( function() { | ||
if (!getElementsByClassName(document,component+' '+showClass)[0]) { removeOverlay(); } | ||
@@ -1051,3 +1054,3 @@ open = self.open = false; | ||
bootstrapCustomEvent.call(modal, hiddenEvent, component); | ||
}, this[duration]); | ||
}); | ||
}; | ||
@@ -1092,3 +1095,2 @@ this.setContent = function( content ) { | ||
animationData = element[getAttribute](dataAnimation), // true / false | ||
durationData = element[getAttribute](dataDuration), | ||
placementData = element[getAttribute](dataPlacement), | ||
@@ -1119,5 +1121,4 @@ dismissibleData = element[getAttribute](dataDismissible), | ||
this[placement] = options[placement] ? options[placement] : placementData || top; | ||
this[delay] = parseInt(options[delay] || delayData) || 100; | ||
this[delay] = parseInt(options[delay] || delayData) || 200; | ||
this[dismissible] = options[dismissible] || dismissibleData === 'true' ? true : false; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; | ||
this[container] = queryElement(options[container]) || queryElement(containerData) || body; | ||
@@ -1179,3 +1180,3 @@ | ||
self[container].appendChild(popover); | ||
popover.style.display = 'block'; | ||
popover[style].display = 'block'; | ||
popover[setAttribute](classString, component+ ' ' + component+'-'+placementSetting + ' ' + self[animation]); | ||
@@ -1208,5 +1209,5 @@ }, | ||
bootstrapCustomEvent.call(element, showEvent, component); | ||
setTimeout(function() { | ||
emulateTransitionEnd(popover, function(){ | ||
bootstrapCustomEvent.call(element, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -1221,6 +1222,6 @@ }, 20 ); | ||
removeClass(popover,showClass); | ||
setTimeout(function() { | ||
emulateTransitionEnd(popover, function() { | ||
removePopover(); | ||
bootstrapCustomEvent.call(element, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -1243,3 +1244,3 @@ }, self[delay] ); | ||
// dismiss on window resize | ||
if ( !(isIE && isIE < 9) ) { on( globalObject, resizeEvent, self.hide ); } | ||
on( globalObject, resizeEvent, self.hide ); | ||
@@ -1341,5 +1342,3 @@ } | ||
on( scrollTarget, scrollEvent, this.refresh ); | ||
if ( !(isIE && isIE < 9)) { | ||
on( globalObject, resizeEvent, this.refresh ); | ||
} | ||
on( globalObject, resizeEvent, this.refresh ); | ||
} | ||
@@ -1366,4 +1365,3 @@ this.refresh(); | ||
// DATA API | ||
var durationData = element[getAttribute](dataDuration), | ||
heightData = element[getAttribute](dataHeight), | ||
var heightData = element[getAttribute](dataHeight), | ||
@@ -1378,4 +1376,3 @@ // strings | ||
options = options || {}; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; // default tab transition duration | ||
this[height] = (isIE && isIE < 10) ? false : (options[height] || heightData === 'true') || false; // filter legacy browsers | ||
this[height] = options[height] || heightData === 'true' || false; | ||
@@ -1429,3 +1426,3 @@ // bind, event targets | ||
if (tabsContentContainer) tabsContentContainer.style[height] = getMaxHeight(activeContent) + 'px'; // height animation | ||
if (tabsContentContainer) tabsContentContainer[style][height] = getMaxHeight(activeContent) + 'px'; // height animation | ||
@@ -1436,5 +1433,5 @@ bootstrapCustomEvent.call(activeTab, hideEvent, component, next); | ||
removeClass(activeContent,showClass); | ||
}, 10); | ||
}, 0); | ||
setTimeout(function() { | ||
emulateTransitionEnd(activeContent, function() { | ||
if (tabsContentContainer) addClass(tabsContentContainer,collapsing); | ||
@@ -1445,3 +1442,4 @@ removeClass(activeContent,active); | ||
addClass(nextContent,showClass); | ||
}, 10); | ||
if (tabsContentContainer) tabsContentContainer[style][height] = getMaxHeight(nextContent) + 'px'; // height animation | ||
}, 0); | ||
@@ -1451,14 +1449,16 @@ bootstrapCustomEvent.call(next, showEvent, component, activeTab); | ||
if(tabsContentContainer) tabsContentContainer.style[height] = getMaxHeight(nextContent) + 'px'; // height animation | ||
}, self[duration]*.7); | ||
}); | ||
setTimeout(function() { | ||
emulateTransitionEnd(nextContent, function() { | ||
bootstrapCustomEvent.call(next, shownEvent, component, activeTab); | ||
if (tabsContentContainer) { // height animation | ||
removeClass(tabsContentContainer,collapsing); | ||
tabsContentContainer.style[height] = ''; | ||
} | ||
activeTab[isAnimating] = next[isAnimating] = false; | ||
}, self[duration]*1.5); | ||
setTimeout(function(){ | ||
emulateTransitionEnd(tabsContentContainer, function(){ | ||
tabsContentContainer[style][height] = ''; | ||
removeClass(tabsContentContainer,collapsing); | ||
activeTab[isAnimating] = next[isAnimating] = false; | ||
}) | ||
},0); | ||
} else { activeTab[isAnimating] = next[isAnimating] = false; } | ||
}); | ||
} | ||
@@ -1493,3 +1493,2 @@ }; | ||
placementData = element[getAttribute](dataPlacement); | ||
durationData = element[getAttribute](dataDuration); | ||
delayData = element[getAttribute](dataDelay), | ||
@@ -1509,4 +1508,3 @@ containerData = element[getAttribute](dataContainer), | ||
this[placement] = options[placement] ? options[placement] : placementData || top; | ||
this[delay] = parseInt(options[delay] || delayData) || 100; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; | ||
this[delay] = parseInt(options[delay] || delayData) || 200; | ||
this[container] = queryElement(options[container]) || queryElement(containerData) || body; | ||
@@ -1559,5 +1557,5 @@ | ||
bootstrapCustomEvent.call(element, showEvent, component); | ||
setTimeout(function() { | ||
emulateTransitionEnd(tooltip, function() { | ||
bootstrapCustomEvent.call(element, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -1572,6 +1570,6 @@ }, 20 ); | ||
removeClass(tooltip,showClass); | ||
setTimeout(function() { | ||
emulateTransitionEnd(tooltip, function() { | ||
removeToolTip(); | ||
bootstrapCustomEvent.call(element, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -1578,0 +1576,0 @@ }, self[delay]); |
@@ -1,2 +0,2 @@ | ||
// Native Javascript for Bootstrap 4 v2.0.3 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document.body,i=null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)&&parseFloat(RegExp.$1),o="data-toggle",l="data-dismiss",a="data-spy",r="data-ride",s="Alert",c="Button",u="Carousel",d="Collapse",h="Dropdown",f="Modal",p="Popover",m="ScrollSpy",v="Tab",g="Tooltip",y="data-backdrop",T="data-keyboard",b="data-duration",x="data-target",w="data-interval",C="data-height",I="data-pause",A="data-original-title",D="data-dismissible",E="data-trigger",L="data-animation",M="data-container",S="data-placement",k="data-delay",B="backdrop",H="keyboard",N="delay",W="duration",P="content",$="target",R="interval",j="pause",O="animation",z="placement",q="container",F="offsetTop",U="offsetLeft",X="scrollTop",Y="scrollLeft",G="clientWidth",J="clientHeight",K="offsetWidth",Q="offsetHeight",V="innerWidth",Z="innerHeight",_="scrollHeight",tt="height",et="aria-expanded",nt="aria-hidden",it="click",ot="hover",lt="keydown",at="resize",rt="scroll",st="show",ct="shown",ut="hide",dt="hidden",ht="close",ft="closed",pt="slid",mt="slide",vt="change",gt="getAttribute",yt="setAttribute",Tt="hasAttribute",bt="getElementsByTagName",xt="getBoundingClientRect",wt="getElementsByClassName",Ct="indexOf",It="parentNode",At="length",Dt="active",Et="show",Lt="collapsing",Mt="left",St="right",kt="top",Bt="bottom",Ht="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Nt=/\b(top|bottom|left|top)+/,Wt=function(t){t.focus?t.focus():t.setActive()},Pt=function(t,e){t.classList.add(e)},$t=function(t,e){t.classList.remove(e)},Rt=function(t,e){return t.classList.contains(e)},jt=function(t,e){return[].slice.call(t[wt](e))},Ot=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},zt=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[It]){if(("."===n||"#"!==n)&&null!==Ot(e,t[It]))return t;if("#"===n&&t.id===e.substr(1))return t}return!1},qt=function(t,e,n){t.addEventListener(e,n,!1)},Ft=function(t,e,n){t.removeEventListener(e,n,!1)},Ut=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},Xt=document[bt]("*"),Yt=function(t,e,n,i){for(var o=i&&i[At]?i:Xt,l=0;l<o[At];l++){var a=o[l][gt](n),r=t.replace(/spy/i,"").toLowerCase();(a&&t===c&&a[Ct](r)>-1||a===r)&&new e(o[l])}},Gt=function(e){var n=e&&(e.currentStyle||t.getComputedStyle(e)),i=/px/.test(n.borderTopWidth)?Math.round(n.borderTopWidth.replace("px","")):0,o=/px/.test(n.borderBottomWidth)?Math.round(n.borderBottomWidth.replace("px","")):0,l=/px/.test(n.marginTop)?Math.round(n.marginTop.replace("px","")):0,a=/px/.test(n.marginBottom)?Math.round(n.marginBottom.replace("px","")):0;return e[J]+parseInt(i)+parseInt(o)+parseInt(l)+parseInt(a)},Jt=function(t){for(var e=0,n=0,i=t.children[At];n<i;n++)e+=Gt(t.children[n]);return e},Kt=function(n){var i=n[xt]();return i[kt]>=0&&i[Mt]>=0&&i[Bt]<=(t[Z]||e[J])&&i[St]<=(t[V]||e[G])},Qt=function(){return{y:t.pageYOffset||e[X],x:t.pageXOffset||e[Y]}},Vt=function(t,e,i,o){var l=t[xt](),a=o===n?Qt():{x:o[U]+o[Y],y:o[F]+o[X]},r={w:l[St]-l[Mt],h:l[Bt]-l[kt]},s={w:e[K],h:e[Q]};i===kt?(e.style[kt]=l[kt]+a.y-s.h+"px",e.style[Mt]=l[Mt]+a.x-s.w/2+r.w/2+"px"):i===Bt?(e.style[kt]=l[kt]+a.y+r.h+"px",e.style[Mt]=l[Mt]+a.x-s.w/2+r.w/2+"px"):i===Mt?(e.style[kt]=l[kt]+a.y-s.h/2+r.h/2+"px",e.style[Mt]=l[Mt]+a.x-s.w+"px"):i===St&&(e.style[kt]=l[kt]+a.y-s.h/2+r.h/2+"px",e.style[Mt]=l[Mt]+a.x+r.w+"px"),e.className[Ct](i)===-1&&(e.className=e.className.replace(Nt,i))},Zt=function(t){return t===kt?Bt:t===Bt?kt:t===Mt?St:t===St?Mt:t},_t=function(t){t=Ot(t);var e=this,n="alert",o=zt(t,"."+n),a=i&&i<10?0:300,r=function(i){var a=i[$];a=a[Tt](l)?a:a[It],a&&a[Tt](l)&&(o=zt(a,"."+n),t=Ot("["+l+'="'+n+'"]',o),(t===a||t===a[It])&&o&&e.close())};this.close=function(){o&&t&&Rt(o,Et)&&(Ut.call(o,ht,n),$t(o,Et),setTimeout(function(){o&&(Ut.call(o,ft,n),Ft(t,it,r),o[It].removeChild(o))},a))},s in t||qt(t,it,r),t[s]=this};Yt(s,_t,l);var te=function(t){t=Ot(t);var e=!1,n="button",i="checked",o="LABEL",l="INPUT",a=function(a){var r=a[$][It],s=a[$].tagName===o?a[$]:r.tagName===o?r:null;if(s){var c=this,u=jt(c,"btn"),d=s[bt](l)[0];if(d){if("checkbox"===d.type&&(d[i]?($t(s,Dt),d[gt](i),d.removeAttribute(i),d[i]=!1):(Pt(s,Dt),d[gt](i),d[yt](i,i),d[i]=!0),e||(e=!0,Ut.call(d,vt,n),Ut.call(t,vt,n))),"radio"===d.type&&!e&&!d[i]){Pt(s,Dt),d[yt](i,i),d[i]=!0,Ut.call(d,vt,n),Ut.call(t,vt,n),e=!0;for(var h=0,f=u[At];h<f;h++){var p=u[h],m=p[bt](l)[0];p!==s&&Rt(p,Dt)&&($t(p,Dt),m.removeAttribute(i),m[i]=!1,Ut.call(m,vt,n))}}setTimeout(function(){e=!1},50)}}};Rt(t,"btn-group")&&(c in t||qt(t,it,a),t[c]=this)};Yt(c,te,o);var ee=function(e,n){e=Ot(e),n=n||{};var o="false"!==e[gt](w)&&(parseInt(e[gt](w))||5e3),l=e[gt](I)===ot||!1,a="true"===e[gt](T)||!1,r=parseInt(e[gt](b))||600,s="carousel",c="paused",d="direction",h="carousel-item",f="data-slide-to";this[H]=n[H]===!0||a,this[j]=!(n[j]!==ot&&!l)&&ot,this[W]=i&&i<10?0:n[W]||r,n[R]||o?this[R]=parseInt(n[R])||o:this[R]=!1;var p=this,m=e.index=0,v=e.timer=0,g=!1,y=jt(e,h),x=y[At],C=this[d]=Mt,A=jt(e,s+"-control-prev")[0],D=jt(e,s+"-control-next")[0],E=Ot("."+s+"-indicators",e),L=E[bt]("LI"),M=function(){p[R]===!1||Rt(e,c)||(Pt(e,c),!g&&clearInterval(v))},S=function(){p[R]!==!1&&Rt(e,c)&&($t(e,c),!g&&clearInterval(v),!g&&p.cycle())},k=function(t){if(t.preventDefault(),!g){var e=t[$],n=p.getActiveIndex();if(!e||Rt(e,Dt)||!e[gt](f))return!1;m=parseInt(e[gt](f),10),n<m||0===n&&m===x-1?C=p[d]=Mt:(n>m||n===x-1&&0===m)&&(C=p[d]=St),p.slideTo(m)}},B=function(t){if(t.preventDefault(),!g){var e=t.currentTarget||t.srcElement;e===D?(m++,C=p[d]=Mt,m===x-1?m=x-1:m===x&&(m=0)):e===A&&(m--,C=p[d]=St,0===m?m=0:m<0&&(m=x-1)),p.slideTo(m)}},N=function(t){if(!g){switch(t.which){case 39:m++,C=p[d]=Mt,m==x-1?m=x-1:m==x&&(m=0);break;case 37:m--,C=p[d]=St,0==m?m=0:m<0&&(m=x-1);break;default:return}p.slideTo(m)}},P=function(t){for(var e=0,n=L[At];e<n;e++)$t(L[e],Dt);L[t]&&Pt(L[t],Dt)};this.cycle=function(){C=this[d]=Mt,v=setInterval(function(){m++,m=m===x?0:m,p.slideTo(m)},this[R])},this.slideTo=function(t){var n=this.getActiveIndex(),o=C===Mt?"next":"prev";Ut.call(e,mt,s,y[t]),g=!0,clearInterval(v),P(t),!Rt(e,"slide")||i&&i<10?(Pt(y[t],Dt),y[t][K],$t(y[n],Dt),setTimeout(function(){g=!1,p[R]&&!Rt(e,c)&&p.cycle(),Ut.call(e,pt,s,y[t])},this[W]+100)):(Pt(y[t],h+"-"+o),y[t][K],Pt(y[t],h+"-"+C),Pt(y[n],h+"-"+C),setTimeout(function(){g=!1,Pt(y[t],Dt),$t(y[n],Dt),$t(y[t],h+"-"+o),$t(y[t],h+"-"+C),$t(y[n],h+"-"+C),p[R]&&!Rt(e,c)&&p.cycle(),Ut.call(e,pt,s,y[t])},this[W]+100))},this.getActiveIndex=function(){return y[Ct](jt(e,h+" active")[0])||0},u in e||(this[j]&&this[R]&&(qt(e,Ht[0],M),qt(e,Ht[1],S),qt(e,"touchstart",M),qt(e,"touchend",S)),D&&qt(D,it,B),A&&qt(A,it,B),E&&qt(E,it,k,!1),this[H]===!0&&qt(t,lt,N,!1)),this.getActiveIndex()<0&&(y[At]&&Pt(y[0],Dt),L[At]&&P(0)),this[R]&&this.cycle(),e[u]=this};Yt(u,ee,r);var ne=function(t,e){t=Ot(t),e=e||{},e.duration=parseInt(e.duration||t[gt](b)),this[W]=i&&i<10?0:e.duration||300;var n=null,o=null,l=this,a=!1,r=t[gt]("data-parent"),s="collapse",c="collapsed",u=function(t){Ut.call(t,st,s),a=!0,$t(t,s),Pt(t,Lt),t.style[tt]="0px",setTimeout(function(){t.style[tt]=Jt(t)+"px"},10),setTimeout(function(){$t(t,Lt),Pt(t,s),Pt(t,Et),t.style[tt]="",a=!1,t[yt](et,"true"),Ut.call(t,ct,s)},l[W])},h=function(t){Ut.call(t,ut,s),a=!0,$t(t,s),t.style[tt]=Jt(t)+"px",setTimeout(function(){Pt(t,Lt),t.style[tt]="0px"},10),setTimeout(function(){$t(t,Lt),$t(t,Et),Pt(t,s),t.style[tt]="",a=!1,t[yt](et,"false"),Ut.call(t,dt,s)},l[W])},f=function(){var e=t.href&&t[gt]("href"),n=t[gt](x),i=e||n&&/#/.test(n)&&n;return i&&Ot(i)};this.toggle=function(t){t.preventDefault(),a||(Rt(o,Et)?l.hide():l.show())},this.hide=function(){h(o),Pt(t,c)},this.show=function(){if(u(o),$t(t,c),null!==n)for(var e=jt(n,s+" "+Et),i=0,l=e[At];i<l;i++)e[i]!==o&&h(e[i])},d in t||qt(t,it,this.toggle),o=f(),n=Ot(e.parent)||r&&zt(t,r),t[d]=this};Yt(d,ne,o);var ie=function(t,e){t=Ot(t),this.persist=e===!0||"true"===t[gt]("data-persist")||!1;var n=this,i=!1,l=t[It],a="dropdown",r=null,s=Ot(".dropdown-menu",l),c=[].slice.call(s[bt]("*")),u=function(t){!i||27!=t.which&&27!=t.keyCode||(r=null,p())},d=function(e){var a,u=e[$];if(u&&u[It]){if(a=u[gt](o)||u[It][gt](o),u===t||u===l||u[It]===t)e.preventDefault(),r=t,n.toggle();else if(i){if((u===s||c&&c[Ct](u)>-1)&&(n.persist||a))return;r=null,p()}(/\#$/.test(u.href)||/\#$/.test(u[It].href))&&e.preventDefault()}},f=function(){Ut.call(l,st,a,r),Pt(l,Et),s[yt](et,!0),Ut.call(l,ct,a,r),qt(document,lt,u),i=!0},p=function(){Ut.call(l,ut,a,r),$t(l,Et),s[yt](et,!1),Ut.call(l,dt,a,r),Ft(document,lt,u),i=!1};this.toggle=function(){Rt(l,Et)&&i?p():f()},h in t||(s[yt]("tabindex","0"),qt(document,it,d)),t[h]=this};Yt(h,ie,o);var oe=function(o,a){o=Ot(o);var r=o[gt](x)||o[gt]("href"),s=Ot(r),c=Rt(o,"modal")?o:s,u="modal",d="static",h="paddingLeft",p="paddingRight",m="modal-backdrop";if(Rt(o,"modal")&&(o=null),c){a=a||{},this[H]=a[H]!==!1&&"false"!==c[gt](T),this[B]=a[B]!==d&&c[gt](y)!==d||d,this[B]=a[B]!==!1&&"false"!==c[gt](y)&&this[B],this[W]=i&&i<10?50:a[W]||parseInt(c[gt](b))||300,this[P]=a[P];var v,g,w,C,I=this,A=this.open=!1,D=null,E=function(){var n=e[xt]();return t[V]||n[St]-Math.abs(n[Mt])},L=function(){var e=n.currentStyle||t.getComputedStyle(n),i=parseInt(e[p],10);v&&(n.style[p]=i+w+"px")},M=function(){n.style[p]=""},S=function(){var t,e=document.createElement("div");return e.className=u+"-scrollbar-measure",n.appendChild(e),t=e[K]-e[G],n.removeChild(e),t},k=function(){v=n[G]<E(),g=c[_]>e[J],w=S()},N=function(){c.style[h]=!v&&g?w+"px":"",c.style[p]=v&&!g?w+"px":""},R=function(){c.style[h]="",c.style[p]=""},j=function(){var t=document.createElement("div");C=Ot("."+m),null===C&&(t[yt]("class",m+" fade"),C=t,n.appendChild(C))},O=function(){C=Ot("."+m),C&&null!==C&&"object"==typeof C&&(n.removeChild(C),C=null)},z=function(){Rt(c,Et)?Ft(document,lt,X):qt(document,lt,X)},q=function(){Rt(c,Et)?Ft(t,at,I.update):qt(t,at,I.update)},F=function(){Rt(c,Et)?Ft(c,it,Y):qt(c,it,Y)},U=function(t){var e=t[$];e=e[Tt](x)||e[Tt]("href")?e:e[It],A||e!==o||Rt(c,Et)||(c.modalTrigger=o,D=o,I.show(),t.preventDefault())},X=function(t){var e=t.which||t.keyCode;I[H]&&27==e&&A&&I.hide()},Y=function(t){var e=t[$];A&&(e[It][gt](l)===u||e[gt](l)===u||e===c&&I[B]!==d)&&(I.hide(),D=null,t.preventDefault())};this.toggle=function(){A&&Rt(c,Et)?this.hide():this.show()},this.show=function(){Ut.call(c,st,u,D);var t=jt(document,u+" in")[0];t&&t!==c&&t.modalTrigger[f].hide(),this[B]&&j(),C&&!Rt(C,Et)&&setTimeout(function(){Pt(C,Et)},0),setTimeout(function(){c.style.display="block",k(),L(),N(),q(),F(),z(),Pt(n,u+"-open"),Pt(c,Et),c[yt](nt,!1)},this[W]/2),setTimeout(function(){A=I.open=!0,Wt(c),Ut.call(c,ct,u,D)},this[W])},this.hide=function(){Ut.call(c,ut,u),C=Ot("."+m),null!==C&&$t(C,Et),$t(c,Et),c[yt](nt,!0),setTimeout(function(){$t(n,u+"-open"),q(),F(),z(),R(),M(),c.style.display=""},this[W]/2),setTimeout(function(){jt(document,u+" "+Et)[0]||O(),A=I.open=!1,o&&Wt(o),Ut.call(c,dt,u)},this[W])},this.setContent=function(t){Ot("."+u+"-content",c).innerHTML=t},this.update=function(){A&&(k(),L(),N())},!o||f in o||qt(o,it,U),this[P]&&this.setContent(this[P]),!!o&&(o[f]=this)}};Yt(f,oe,o);var le=function(e,o){e=Ot(e);var l=e[gt](E),a=e[gt](L),r=e[gt](b),s=e[gt](S),c=e[gt](D),u=e[gt](k),d=e[gt](M),h="popover",f="template",m="trigger",v="class",g="div",y="fade",T="data-title",x="data-content",w="dismissible",C='<button type="button" class="close">×</button>';o=o||{},this[f]=o[f]?o[f]:null,this[m]=o[m]?o[m]:l||ot,this[O]=o[O]&&o[O]!==y?o[O]:a||y,this[z]=o[z]?o[z]:s||kt,this[N]=parseInt(o[N]||u)||100,this[w]=!(!o[w]&&"true"!==c),this[W]=i&&i<10?0:parseInt(o[W]||r)||150,this[q]=Ot(o[q])||Ot(d)||n;var I=this,A=e[gt](T)||null,B=e[gt](x)||null;if(B||this[f]){var H=null,P=0,R=this[z],j=function(t){null!==H&&t[$]===Ot(".close",H)&&I.hide()},F=function(){I[q].removeChild(H),P=null,H=null},U=function(){if(A=e[gt](T),B=e[gt](x),H=document.createElement(g),null!==B&&null===I[f]){if(H[yt]("role","tooltip"),null!==A){var t=document.createElement("h3");t[yt](v,h+"-title"),t.innerHTML=I[w]?A+C:A,H.appendChild(t)}var n=document.createElement(g);n[yt](v,h+"-content"),n.innerHTML=I[w]&&null===A?B+C:B,H.appendChild(n)}else{var i=document.createElement(g);i.innerHTML=I[f],H.innerHTML=i.firstChild.innerHTML}I[q].appendChild(H),H.style.display="block",H[yt](v,h+" "+h+"-"+R+" "+I[O])},X=function(){!Rt(H,Et)&&Pt(H,Et)},Y=function(){Vt(e,H,R,I[q]),Kt(H)||(R=Zt(R),Vt(e,H,R,I[q]))};this.toggle=function(){null===H?I.show():I.hide()},this.show=function(){clearTimeout(P),P=setTimeout(function(){null===H&&(R=I[z],U(),Y(),X(),Ut.call(e,st,h),setTimeout(function(){Ut.call(e,ct,h)},I[W]))},20)},this.hide=function(){clearTimeout(P),P=setTimeout(function(){H&&null!==H&&Rt(H,Et)&&(Ut.call(e,ut,h),$t(H,Et),setTimeout(function(){F(),Ut.call(e,dt,h)},I[W]))},I[N])},p in e||(I[m]===ot?(qt(e,Ht[0],I.show),I[w]||qt(e,Ht[1],I.hide)):/^(click|focus)$/.test(I[m])&&(qt(e,I[m],I.toggle),I[w]||qt(e,"blur",I.hide)),I[w]&&qt(document,it,j),i&&i<9||qt(t,at,I.hide)),e[p]=I}};Yt(p,le,o);var ae=function(e,n){e=Ot(e);var o=Ot(e[gt](x));if(n=n||{},n[$]||o){for(var l,a=n[$]&&Ot(n[$])||o,r=a&&a[bt]("A"),s=[],c=[],u=e[Q]<e[_]?e:t,d=u===t,h=0,f=r[At];h<f;h++){var p=r[h][gt]("href"),v=p&&/#[a-z0-9]+$/i.test(p)&&Ot(p);v&&(s.push(r[h]),c.push(v))}var g=function(t){var n=s[t],i=c[t],o=n[It][It],a=Rt(o,"dropdown")&&o[bt]("A")[0],r=d&&i[xt](),u=Rt(n,Dt)||!1,h=d?r[kt]+l:i[F]-(c[t-1]?0:10),f=d?r[Bt]+l:c[t+1]?c[t+1][F]:e[_],p=l>=h&&f>l;if(!u&&p)Rt(n,Dt)||(Pt(n,Dt),u=!0,a&&!Rt(a,Dt)&&Pt(a,Dt),Ut.call(e,"activate","scrollspy",s[t]));else if(p){if(!p&&!u||u&&p)return}else Rt(n,Dt)&&($t(n,Dt),u=!1,a&&Rt(a,Dt)&&!jt(n[It],Dt).length&&$t(a,Dt))},y=function(){l=d?Qt().y:e[X];for(var t=0,n=s[At];t<n;t++)g(t)};this.refresh=function(){y()},m in e||(qt(u,rt,this.refresh),i&&i<9||qt(t,at,this.refresh)),this.refresh(),e[m]=this}};Yt(m,ae,a);var re=function(t,e){t=Ot(t);var n=t[gt](b),o=t[gt](C),l="tab",a="height",r="isAnimating";t[r]=!1,e=e||{},this[W]=i&&i<10?0:parseInt(e[W]||n)||150,this[a]=!(i&&i<10)&&(e[a]||"true"===o||!1);var s,c,u=this,d=zt(t,".nav"),h=Ot(".dropdown",d);h=h&&h[bt]("A")[0];var f=function(){var t,e=jt(d,Dt);return 1!==e[At]||Rt(e[0][It],"dropdown")?e[At]>1&&(t=e[e[At]-1]):t=e[0],t},p=function(){return Ot(f()[gt]("href"))},m=function(t){t.preventDefault(),s=t[$],u.show()};this.show=function(){var e=Ot(s[gt]("href")),n=f(),i=p();n[r]&&s[r]||Rt(s,Dt)||(n[r]=s[r]=!0,$t(n,Dt),Pt(s,Dt),h&&(Rt(t[It],"dropdown-menu")?Rt(h,Dt)||Pt(h,Dt):Rt(h,Dt)&&$t(h,Dt)),c&&(c.style[a]=Jt(i)+"px"),Ut.call(n,ut,l,s),setTimeout(function(){$t(i,Et)},10),setTimeout(function(){c&&Pt(c,Lt),$t(i,Dt),Pt(e,Dt),setTimeout(function(){Pt(e,Et)},10),Ut.call(s,st,l,n),Ut.call(n,dt,l,s),c&&(c.style[a]=Jt(e)+"px")},.7*u[W]),setTimeout(function(){Ut.call(s,ct,l,n),c&&($t(c,Lt),c.style[a]=""),n[r]=s[r]=!1},1.5*u[W]))},v in t||qt(t,it,m),this[a]&&(c=p()[It]),t[v]=this};Yt(v,re,o);var se=function(t,e){t=Ot(t);var o=t[gt](L);placementData=t[gt](S),durationData=t[gt](b),delayData=t[gt](k),containerData=t[gt](M),component="tooltip",classString="class",title="title",fade="fade",div="div",e=e||{},this[O]=e[O]&&e[O]!==fade?e[O]:o||fade,this[z]=e[z]?e[z]:placementData||kt,this[N]=parseInt(e[N]||delayData)||100,this[W]=i&&i<10?0:parseInt(e[W]||durationData)||150,this[q]=Ot(e[q])||Ot(containerData)||n;var l=this,a=0,r=this[z],s=null,c=t[gt](title)||t[gt](A);if(c){var u=function(){l[q].removeChild(s),s=null,a=null},d=function(){c=t[gt](title)||t[gt](A),s=document.createElement(div),s[yt]("role",component);var e=document.createElement(div);e[yt](classString,component+"-inner"),s.appendChild(e),e.innerHTML=c,l[q].appendChild(s),s[yt](classString,component+" "+component+"-"+r+" "+l[O])},h=function(){Vt(t,s,r,l[q]),Kt(s)||(r=Zt(r),Vt(t,s,r,l[q]))},f=function(){!Rt(s,Et)&&Pt(s,Et)};this.show=function(){clearTimeout(a),a=setTimeout(function(){null===s&&(r=l[z],d(),h(),f(),Ut.call(t,st,component),setTimeout(function(){Ut.call(t,ct,component)},l[W]))},20)},this.hide=function(){clearTimeout(a),a=setTimeout(function(){s&&null!==s&&Rt(s,Et)&&(Ut.call(t,ut,component),$t(s,Et),setTimeout(function(){u(),Ut.call(t,dt,component)},l[W]))},l[N])},this.toggle=function(){s?l.hide():l.show()},g in t||(t[yt](A,c),t.removeAttribute(title),qt(t,Ht[0],this.show),qt(t,Ht[1],this.hide)),t[g]=this}};return Yt(g,se,o),{Alert:_t,Button:te,Carousel:ee,Collapse:ne,Dropdown:ie,Modal:oe,Popover:le,ScrollSpy:ae,Tab:re,Tooltip:se}}); | ||
// Native Javascript for Bootstrap 4 v2.0.4 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document.body,i="data-toggle",o="data-dismiss",a="data-spy",l="data-ride",r="Alert",c="Button",s="Carousel",u="Collapse",d="Dropdown",f="Modal",h="Popover",p="ScrollSpy",v="Tab",m="Tooltip",g="data-backdrop",T="data-keyboard",b="data-target",y="data-interval",w="data-height",x="data-pause",C="data-original-title",A="data-dismissible",I="data-trigger",L="data-animation",D="data-container",E="data-placement",S="data-delay",k="backdrop",M="keyboard",B="delay",H="content",N="target",W="interval",P="pause",$="animation",j="placement",O="container",z="offsetTop",R="offsetLeft",q="scrollTop",U="scrollLeft",X="clientWidth",Y="clientHeight",F="offsetWidth",G="offsetHeight",J="innerWidth",K="innerHeight",Q="scrollHeight",V="height",Z="aria-expanded",_="aria-hidden",tt="click",et="hover",nt="keydown",it="resize",ot="scroll",at="show",lt="shown",rt="hide",ct="hidden",st="close",ut="closed",dt="slid",ft="slide",ht="change",pt="getAttribute",vt="setAttribute",mt="hasAttribute",gt="getElementsByTagName",Tt="getBoundingClientRect",bt="getElementsByClassName",yt="indexOf",wt="parentNode",xt="length",Ct="toLowerCase",At="Transition",It="Webkit",Lt="style",Dt="active",Et="show",St="collapsing",kt="left",Mt="right",Bt="top",Ht="bottom",Nt="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Wt=/\b(top|bottom|left|top)+/,Pt=It+At in e[Lt]||At[Ct]()in e[Lt],$t=It+At in e[Lt]?It[Ct]()+At+"End":At[Ct]()+"end",jt=function(t){t.focus?t.focus():t.setActive()},Ot=function(t,e){t.classList.add(e)},zt=function(t,e){t.classList.remove(e)},Rt=function(t,e){return t.classList.contains(e)},qt=function(t,e){return[].slice.call(t[bt](e))},Ut=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},Xt=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[wt]){if(("."===n||"#"!==n)&&null!==Ut(e,t[wt]))return t;if("#"===n&&t.id===e.substr(1))return t}return!1},Yt=function(t,e,n){t.addEventListener(e,n,!1)},Ft=function(t,e,n){t.removeEventListener(e,n,!1)},Gt=function(t,e,n){Yt(t,e,function i(){n(),Ft(t,e,i)})},Jt=function(t,e){Pt?Gt(t,$t,e):e()},Kt=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},Qt=document[gt]("*"),Vt=function(t,e,n,i){for(var o=i&&i[xt]?i:Qt,a=0;a<o[xt];a++){var l=o[a][pt](n),r=t.replace(/spy/i,"").toLowerCase();(l&&t===c&&l[yt](r)>-1||l===r)&&new e(o[a])}},Zt=function(e){var n=e&&t.getComputedStyle(e),i=/px/.test(n.borderTopWidth)?Math.round(n.borderTopWidth.replace("px","")):0,o=/px/.test(n.borderBottomWidth)?Math.round(n.borderBottomWidth.replace("px","")):0,a=/px/.test(n.marginTop)?Math.round(n.marginTop.replace("px","")):0,l=/px/.test(n.marginBottom)?Math.round(n.marginBottom.replace("px","")):0;return e[Y]+parseInt(i)+parseInt(o)+parseInt(a)+parseInt(l)},_t=function(t){for(var e=0,n=0,i=t.children[xt];n<i;n++)e+=Zt(t.children[n]);return e},te=function(n){var i=n[Tt]();return i[Bt]>=0&&i[kt]>=0&&i[Ht]<=(t[K]||e[Y])&&i[Mt]<=(t[J]||e[X])},ee=function(){return{y:t.pageYOffset||e[q],x:t.pageXOffset||e[U]}},ne=function(t,e,i,o){var a=t[Tt](),l=o===n?ee():{x:o[R]+o[U],y:o[z]+o[q]},r={w:a[Mt]-a[kt],h:a[Ht]-a[Bt]},c={w:e[F],h:e[G]};i===Bt?(e[Lt][Bt]=a[Bt]+l.y-c.h+"px",e[Lt][kt]=a[kt]+l.x-c.w/2+r.w/2+"px"):i===Ht?(e[Lt][Bt]=a[Bt]+l.y+r.h+"px",e[Lt][kt]=a[kt]+l.x-c.w/2+r.w/2+"px"):i===kt?(e[Lt][Bt]=a[Bt]+l.y-c.h/2+r.h/2+"px",e[Lt][kt]=a[kt]+l.x-c.w+"px"):i===Mt&&(e[Lt][Bt]=a[Bt]+l.y-c.h/2+r.h/2+"px",e[Lt][kt]=a[kt]+l.x+r.w+"px"),e.className[yt](i)===-1&&(e.className=e.className.replace(Wt,i))},ie=function(t){return t===Bt?Ht:t===Ht?Bt:t===kt?Mt:t===Mt?kt:t},oe=function(t){t=Ut(t);var e=this,n="alert",i=Xt(t,"."+n),a=function(a){var l=a[N];l=l[mt](o)?l:l[wt],l&&l[mt](o)&&(i=Xt(l,"."+n),t=Ut("["+o+'="'+n+'"]',i),(t===l||t===l[wt])&&i&&e.close())},l=function(){Kt.call(i,ut,n),Ft(t,tt,a),i[wt].removeChild(i)};this.close=function(){i&&t&&Rt(i,Et)&&(Kt.call(i,st,n),zt(i,Et),i&&Jt(i,l))},r in t||Yt(t,tt,a),t[r]=this};Vt(r,oe,o);var ae=function(t){t=Ut(t);var e=!1,n="button",i="checked",o="LABEL",a="INPUT",l=function(l){var r=l[N][wt],c=l[N].tagName===o?l[N]:r.tagName===o?r:null;if(c){var s=this,u=qt(s,"btn"),d=c[gt](a)[0];if(d){if("checkbox"===d.type&&(d[i]?(zt(c,Dt),d[pt](i),d.removeAttribute(i),d[i]=!1):(Ot(c,Dt),d[pt](i),d[vt](i,i),d[i]=!0),e||(e=!0,Kt.call(d,ht,n),Kt.call(t,ht,n))),"radio"===d.type&&!e&&!d[i]){Ot(c,Dt),d[vt](i,i),d[i]=!0,Kt.call(d,ht,n),Kt.call(t,ht,n),e=!0;for(var f=0,h=u[xt];f<h;f++){var p=u[f],v=p[gt](a)[0];p!==c&&Rt(p,Dt)&&(zt(p,Dt),v.removeAttribute(i),v[i]=!1,Kt.call(v,ht,n))}}setTimeout(function(){e=!1},50)}}};Rt(t,"btn-group")&&(c in t||Yt(t,tt,l),t[c]=this)};Vt(c,ae,i);var le=function(e,n){e=Ut(e),n=n||{};var i="false"!==e[pt](y)&&(parseInt(e[pt](y))||5e3),o=e[pt](x)===et||!1,a="true"===e[pt](T)||!1,l="carousel",r="paused",c="direction",u="carousel-item",d="data-slide-to";this[M]=n[M]===!0||a,this[P]=!(n[P]!==et&&!o)&&et,n[W]||i?this[W]=parseInt(n[W])||i:this[W]=!1;var f=this,h=e.index=0,p=e.timer=0,v=this.isSliding=!1,m=qt(e,u),g=m[xt],b=this[c]=kt,w=qt(e,l+"-control-prev")[0],C=qt(e,l+"-control-next")[0],A=Ut("."+l+"-indicators",e),I=A[gt]("LI"),L=function(){f[W]===!1||Rt(e,r)||(Ot(e,r),!v&&clearInterval(p))},D=function(){f[W]!==!1&&Rt(e,r)&&(zt(e,r),!v&&clearInterval(p),!v&&f.cycle())},E=function(t){if(t.preventDefault(),!v){var e=t[N],n=f.getActiveIndex();if(!e||Rt(e,Dt)||!e[pt](d))return!1;h=parseInt(e[pt](d),10),n<h||0===n&&h===g-1?b=f[c]=kt:(n>h||n===g-1&&0===h)&&(b=f[c]=Mt),f.slideTo(h)}},S=function(t){if(t.preventDefault(),!v){var e=t.currentTarget||t.srcElement;e===C?(h++,b=f[c]=kt,h===g-1?h=g-1:h===g&&(h=0)):e===w&&(h--,b=f[c]=Mt,0===h?h=0:h<0&&(h=g-1)),f.slideTo(h)}},k=function(t){if(!v){switch(t.which){case 39:h++,b=f[c]=kt,h==g-1?h=g-1:h==g&&(h=0);break;case 37:h--,b=f[c]=Mt,0==h?h=0:h<0&&(h=g-1);break;default:return}f.slideTo(h)}},B=function(t){for(var e=0,n=I[xt];e<n;e++)zt(I[e],Dt);I[t]&&Ot(I[t],Dt)};this.cycle=function(){b=this[c]=kt,p=setInterval(function(){h++,h=h===g?0:h,f.slideTo(h)},this[W])},this.slideTo=function(t){var n=this.getActiveIndex(),i=b===kt?"next":"prev";Kt.call(e,ft,l,m[t]),v=this.isSliding=!0,clearInterval(p),B(t),Pt&&Rt(e,"slide")?(Ot(m[t],u+"-"+i),m[t][F],Ot(m[t],u+"-"+b),Ot(m[n],u+"-"+b),Gt(m[t],$t,function(){v=f.isSliding=!1,Ot(m[t],Dt),zt(m[n],Dt),zt(m[t],u+"-"+i),zt(m[t],u+"-"+b),zt(m[n],u+"-"+b),f[W]&&!Rt(e,r)&&f.cycle(),Kt.call(e,dt,l,m[t])})):(Ot(m[t],Dt),m[t][F],zt(m[n],Dt),setTimeout(function(){v=!1,f[W]&&!Rt(e,r)&&f.cycle(),Kt.call(e,dt,l,m[t])},100))},this.getActiveIndex=function(){return m[yt](qt(e,u+" active")[0])||0},s in e||(this[P]&&this[W]&&(Yt(e,Nt[0],L),Yt(e,Nt[1],D),Yt(e,"touchstart",L),Yt(e,"touchend",D)),C&&Yt(C,tt,S),w&&Yt(w,tt,S),A&&Yt(A,tt,E,!1),this[M]===!0&&Yt(t,nt,k,!1)),this.getActiveIndex()<0&&(m[xt]&&Ot(m[0],Dt),I[xt]&&B(0)),this[W]&&this.cycle(),e[s]=this};Vt(s,le,l);var re=function(t,e){t=Ut(t),e=e||{};var n=null,i=null,o=this,a=!1,l=t[pt]("data-parent"),r="collapse",c="collapsed",s=function(t){Kt.call(t,at,r),a=!0,Ot(t,St),Ot(t,Et),setTimeout(function(){t[Lt][V]=_t(t)+"px"},0),Jt(t,function(){zt(t,St),t[Lt][V]="",a=!1,t[vt](Z,"true"),Kt.call(t,lt,r)})},d=function(t){Kt.call(t,rt,r),a=!0,t[Lt][V]=_t(t)+"px",setTimeout(function(){Ot(t,St),t[Lt][V]="0px"},0),Jt(t,function(){zt(t,St),zt(t,Et),t[Lt][V]="",a=!1,t[vt](Z,"false"),Kt.call(t,ct,r)})},f=function(){var e=t.href&&t[pt]("href"),n=t[pt](b),i=e||n&&/#/.test(n)&&n;return i&&Ut(i)};this.toggle=function(t){t.preventDefault(),a||(Rt(i,Et)?o.hide():o.show())},this.hide=function(){d(i),Ot(t,c)},this.show=function(){if(s(i),zt(t,c),null!==n)for(var e=qt(n,r+" "+Et),o=0,a=e[xt];o<a;o++)e[o]!==i&&d(e[o])},u in t||Yt(t,tt,this.toggle),i=f(),n=Ut(e.parent)||l&&Xt(t,l),t[u]=this};Vt(u,re,i);var ce=function(t,e){t=Ut(t),this.persist=e===!0||"true"===t[pt]("data-persist")||!1;var n=this,o=!1,a=t[wt],l="dropdown",r=null,c=Ut(".dropdown-menu",a),s=[].slice.call(c[gt]("*")),u=function(t){!o||27!=t.which&&27!=t.keyCode||(r=null,p())},f=function(e){var l,u=e[N];if(l=1!==u.nodeType&&(u[pt](i)||u[wt][pt](i)),u===t||u===a||u[wt]===t)e.preventDefault(),r=t,n.toggle();else if(o){if((u===c||s&&s[yt](u)>-1)&&(n.persist||l))return;r=null,p()}(/\#$/.test(u.href)||u[wt]&&/\#$/.test(u[wt].href))&&e.preventDefault()},h=function(){Kt.call(a,at,l,r),Ot(a,Et),c[vt](Z,!0),Kt.call(a,lt,l,r),Yt(document,nt,u),o=!0},p=function(){Kt.call(a,rt,l,r),zt(a,Et),c[vt](Z,!1),Kt.call(a,ct,l,r),Ft(document,nt,u),o=!1};this.toggle=function(){Rt(a,Et)&&o?p():h()},d in t||(c[vt]("tabindex","0"),Yt(document,tt,f)),t[d]=this};Vt(d,ce,i);var se=function(i,a){i=Ut(i);var l=i[pt](b)||i[pt]("href"),r=Ut(l),c=Rt(i,"modal")?i:r,s="modal",u="static",d="paddingLeft",h="paddingRight",p="modal-backdrop";if(Rt(i,"modal")&&(i=null),c){a=a||{},this[M]=a[M]!==!1&&"false"!==c[pt](T),this[k]=a[k]!==u&&c[pt](g)!==u||u,this[k]=a[k]!==!1&&"false"!==c[pt](g)&&this[k],this[H]=a[H];var v,m,y,w,x=this,C=this.open=!1,A=null,I=function(){var n=e[Tt]();return t[J]||n[Mt]-Math.abs(n[kt])},L=function(){var e=n.currentStyle||t.getComputedStyle(n),i=parseInt(e[h],10);v&&(n[Lt][h]=i+y+"px")},D=function(){n[Lt][h]=""},E=function(){var t,e=document.createElement("div");return e.className=s+"-scrollbar-measure",n.appendChild(e),t=e[F]-e[X],n.removeChild(e),t},S=function(){v=n[X]<I(),m=c[Q]>e[Y],y=E()},B=function(){c[Lt][d]=!v&&m?y+"px":"",c[Lt][h]=v&&!m?y+"px":""},W=function(){c[Lt][d]="",c[Lt][h]=""},P=function(){var t=document.createElement("div");w=Ut("."+p),null===w&&(t[vt]("class",p+" fade"),w=t,n.appendChild(w))},$=function(){w=Ut("."+p),w&&null!==w&&"object"==typeof w&&(n.removeChild(w),w=null)},j=function(){Rt(c,Et)?Ft(document,nt,q):Yt(document,nt,q)},O=function(){Rt(c,Et)?Ft(t,it,x.update):Yt(t,it,x.update)},z=function(){Rt(c,Et)?Ft(c,tt,U):Yt(c,tt,U)},R=function(t){var e=t[N];e=e[mt](b)||e[mt]("href")?e:e[wt],C||e!==i||Rt(c,Et)||(c.modalTrigger=i,A=i,x.show(),t.preventDefault())},q=function(t){var e=t.which||t.keyCode;x[M]&&27==e&&C&&x.hide()},U=function(t){var e=t[N];C&&(e[wt][pt](o)===s||e[pt](o)===s||e===c&&x[k]!==u)&&(x.hide(),A=null,t.preventDefault())};this.toggle=function(){C&&Rt(c,Et)?this.hide():this.show()},this.show=function(){Kt.call(c,at,s,A);var t=qt(document,s+" "+Et)[0];t&&t!==c&&t.modalTrigger[f].hide(),this[k]&&P(),w&&!Rt(w,Et)&&setTimeout(function(){Ot(w,Et)},0),setTimeout(function(){c[Lt].display="block",S(),L(),B(),O(),z(),j(),Ot(n,s+"-open"),Ot(c,Et),c[vt](_,!1)},0),Jt(c,function(){C=x.open=!0,jt(c),Kt.call(c,lt,s,A)})},this.hide=function(){Kt.call(c,rt,s),w=Ut("."+p),null!==w&&zt(w,Et),zt(c,Et),c[vt](_,!0),Jt(c,function(){zt(n,s+"-open"),O(),z(),j(),W(),D(),c[Lt].display="",qt(document,s+" "+Et)[0]||$(),C=x.open=!1,i&&jt(i),Kt.call(c,ct,s)})},this.setContent=function(t){Ut("."+s+"-content",c).innerHTML=t},this.update=function(){C&&(S(),L(),B())},!i||f in i||Yt(i,tt,R),this[H]&&this.setContent(this[H]),!!i&&(i[f]=this)}};Vt(f,se,i);var ue=function(e,i){e=Ut(e);var o=e[pt](I),a=e[pt](L),l=e[pt](E),r=e[pt](A),c=e[pt](S),s=e[pt](D),u="popover",d="template",f="trigger",p="class",v="div",m="fade",g="data-title",T="data-content",b="dismissible",y='<button type="button" class="close">×</button>';i=i||{},this[d]=i[d]?i[d]:null,this[f]=i[f]?i[f]:o||et,this[$]=i[$]&&i[$]!==m?i[$]:a||m,this[j]=i[j]?i[j]:l||Bt,this[B]=parseInt(i[B]||c)||200,this[b]=!(!i[b]&&"true"!==r),this[O]=Ut(i[O])||Ut(s)||n;var w=this,x=e[pt](g)||null,C=e[pt](T)||null;if(C||this[d]){var k=null,M=0,H=this[j],W=function(t){null!==k&&t[N]===Ut(".close",k)&&w.hide()},P=function(){w[O].removeChild(k),M=null,k=null},z=function(){if(x=e[pt](g),C=e[pt](T),k=document.createElement(v),null!==C&&null===w[d]){if(k[vt]("role","tooltip"),null!==x){var t=document.createElement("h3");t[vt](p,u+"-title"),t.innerHTML=w[b]?x+y:x,k.appendChild(t)}var n=document.createElement(v);n[vt](p,u+"-content"),n.innerHTML=w[b]&&null===x?C+y:C,k.appendChild(n)}else{var i=document.createElement(v);i.innerHTML=w[d],k.innerHTML=i.firstChild.innerHTML}w[O].appendChild(k),k[Lt].display="block",k[vt](p,u+" "+u+"-"+H+" "+w[$])},R=function(){!Rt(k,Et)&&Ot(k,Et)},q=function(){ne(e,k,H,w[O]),te(k)||(H=ie(H),ne(e,k,H,w[O]))};this.toggle=function(){null===k?w.show():w.hide()},this.show=function(){clearTimeout(M),M=setTimeout(function(){null===k&&(H=w[j],z(),q(),R(),Kt.call(e,at,u),Jt(k,function(){Kt.call(e,lt,u)}))},20)},this.hide=function(){clearTimeout(M),M=setTimeout(function(){k&&null!==k&&Rt(k,Et)&&(Kt.call(e,rt,u),zt(k,Et),Jt(k,function(){P(),Kt.call(e,ct,u)}))},w[B])},h in e||(w[f]===et?(Yt(e,Nt[0],w.show),w[b]||Yt(e,Nt[1],w.hide)):/^(click|focus)$/.test(w[f])&&(Yt(e,w[f],w.toggle),w[b]||Yt(e,"blur",w.hide)),w[b]&&Yt(document,tt,W),Yt(t,it,w.hide)),e[h]=w}};Vt(h,ue,i);var de=function(e,n){e=Ut(e);var i=Ut(e[pt](b));if(n=n||{},n[N]||i){for(var o,a=n[N]&&Ut(n[N])||i,l=a&&a[gt]("A"),r=[],c=[],s=e[G]<e[Q]?e:t,u=s===t,d=0,f=l[xt];d<f;d++){var h=l[d][pt]("href"),v=h&&/#[a-z0-9]+$/i.test(h)&&Ut(h);v&&(r.push(l[d]),c.push(v))}var m=function(t){var n=r[t],i=c[t],a=n[wt][wt],l=Rt(a,"dropdown")&&a[gt]("A")[0],s=u&&i[Tt](),d=Rt(n,Dt)||!1,f=u?s[Bt]+o:i[z]-(c[t-1]?0:10),h=u?s[Ht]+o:c[t+1]?c[t+1][z]:e[Q],p=o>=f&&h>o;if(!d&&p)Rt(n,Dt)||(Ot(n,Dt),d=!0,l&&!Rt(l,Dt)&&Ot(l,Dt),Kt.call(e,"activate","scrollspy",r[t]));else if(p){if(!p&&!d||d&&p)return}else Rt(n,Dt)&&(zt(n,Dt),d=!1,l&&Rt(l,Dt)&&!qt(n[wt],Dt).length&&zt(l,Dt))},g=function(){o=u?ee().y:e[q];for(var t=0,n=r[xt];t<n;t++)m(t)};this.refresh=function(){g()},p in e||(Yt(s,ot,this.refresh),Yt(t,it,this.refresh)),this.refresh(),e[p]=this}};Vt(p,de,a);var fe=function(t,e){t=Ut(t);var n=t[pt](w),i="tab",o="height",a="isAnimating";t[a]=!1,e=e||{},this[o]=e[o]||"true"===n||!1;var l,r,c=this,s=Xt(t,".nav"),u=Ut(".dropdown",s);u=u&&u[gt]("A")[0];var d=function(){var t,e=qt(s,Dt);return 1!==e[xt]||Rt(e[0][wt],"dropdown")?e[xt]>1&&(t=e[e[xt]-1]):t=e[0],t},f=function(){return Ut(d()[pt]("href"))},h=function(t){t.preventDefault(),l=t[N],c.show()};this.show=function(){var e=Ut(l[pt]("href")),n=d(),c=f();n[a]&&l[a]||Rt(l,Dt)||(n[a]=l[a]=!0,zt(n,Dt),Ot(l,Dt),u&&(Rt(t[wt],"dropdown-menu")?Rt(u,Dt)||Ot(u,Dt):Rt(u,Dt)&&zt(u,Dt)),r&&(r[Lt][o]=_t(c)+"px"),Kt.call(n,rt,i,l),setTimeout(function(){zt(c,Et)},0),Jt(c,function(){r&&Ot(r,St),zt(c,Dt),Ot(e,Dt),setTimeout(function(){Ot(e,Et),r&&(r[Lt][o]=_t(e)+"px")},0),Kt.call(l,at,i,n),Kt.call(n,ct,i,l)}),Jt(e,function(){Kt.call(l,lt,i,n),r?setTimeout(function(){Jt(r,function(){r[Lt][o]="",zt(r,St),n[a]=l[a]=!1})},0):n[a]=l[a]=!1}))},v in t||Yt(t,tt,h),this[o]&&(r=f()[wt]),t[v]=this};Vt(v,fe,i);var he=function(t,e){t=Ut(t);var i=t[pt](L);placementData=t[pt](E),delayData=t[pt](S),containerData=t[pt](D),component="tooltip",classString="class",title="title",fade="fade",div="div",e=e||{},this[$]=e[$]&&e[$]!==fade?e[$]:i||fade,this[j]=e[j]?e[j]:placementData||Bt,this[B]=parseInt(e[B]||delayData)||200,this[O]=Ut(e[O])||Ut(containerData)||n;var o=this,a=0,l=this[j],r=null,c=t[pt](title)||t[pt](C);if(c){var s=function(){o[O].removeChild(r),r=null,a=null},u=function(){c=t[pt](title)||t[pt](C),r=document.createElement(div),r[vt]("role",component);var e=document.createElement(div);e[vt](classString,component+"-inner"),r.appendChild(e),e.innerHTML=c,o[O].appendChild(r),r[vt](classString,component+" "+component+"-"+l+" "+o[$])},d=function(){ne(t,r,l,o[O]),te(r)||(l=ie(l),ne(t,r,l,o[O]))},f=function(){!Rt(r,Et)&&Ot(r,Et)};this.show=function(){clearTimeout(a),a=setTimeout(function(){null===r&&(l=o[j],u(),d(),f(),Kt.call(t,at,component),Jt(r,function(){Kt.call(t,lt,component)}))},20)},this.hide=function(){clearTimeout(a),a=setTimeout(function(){r&&null!==r&&Rt(r,Et)&&(Kt.call(t,rt,component),zt(r,Et),Jt(r,function(){s(),Kt.call(t,ct,component)}))},o[B])},this.toggle=function(){r?o.hide():o.show()},m in t||(t[vt](C,c),t.removeAttribute(title),Yt(t,Nt[0],this.show),Yt(t,Nt[1],this.hide)),t[m]=this}};return Vt(m,he,i),{Alert:oe,Button:ae,Carousel:le,Collapse:re,Dropdown:ce,Modal:se,Popover:ue,ScrollSpy:de,Tab:fe,Tooltip:he}}); |
@@ -1,2 +0,2 @@ | ||
// Native Javascript for Bootstrap 3 v2.0.3 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Affix=n.Affix,t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document.body,i=null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)&&parseFloat(RegExp.$1),o="data-toggle",a="data-dismiss",l="data-spy",r="data-ride",s="Affix",c="Alert",u="Button",f="Carousel",d="Collapse",h="Dropdown",p="Modal",m="Popover",v="ScrollSpy",g="Tab",y="Tooltip",T="data-backdrop",x="data-keyboard",b="data-duration",w="data-target",I="data-interval",C="data-height",A="data-pause",L="data-original-title",E="data-original-text",M="data-dismissible",D="data-trigger",S="data-animation",k="data-container",H="data-placement",B="data-delay",N="data-offset-top",W="data-offset-bottom",$="backdrop",P="keyboard",R="delay",j="duration",z="content",O="target",q="interval",F="pause",U="animation",X="placement",Y="container",G="offsetTop",J="offsetBottom",K="offsetLeft",Q="scrollTop",V="scrollLeft",Z="clientWidth",_="clientHeight",tt="offsetWidth",et="offsetHeight",nt="innerWidth",it="innerHeight",ot="scrollHeight",at="height",lt="aria-expanded",rt="aria-hidden",st="click",ct="hover",ut="keydown",ft="resize",dt="scroll",ht="show",pt="shown",mt="hide",vt="hidden",gt="close",yt="closed",Tt="slid",xt="slide",bt="change",wt="getAttribute",It="setAttribute",Ct="hasAttribute",At="getElementsByTagName",Lt="getBoundingClientRect",Et="querySelectorAll",Mt="getElementsByClassName",Dt="indexOf",St="parentNode",kt="length",Ht="active",Bt="in",Nt="collapsing",Wt="disabled",$t="loading",Pt="left",Rt="right",jt="top",zt="bottom",Ot="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],qt=/\b(top|bottom|left|top)+/,Ft=function(t){t.focus?t.focus():t.setActive()},Ut=function(t,e){t.classList.add(e)},Xt=function(t,e){t.classList.remove(e)},Yt=function(t,e){return t.classList.contains(e)},Gt=function(t){for(var e=[],n=0,i=t[kt];n<i;n++)e.push(t[n]);return e},Jt=function(t,e){var n=8===i?Et:Mt;return Gt(t[n](8===i?"."+e.replace(/\s(?=[a-z])/g,"."):e))},Kt=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},Qt=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[St]){if(("."===n||"#"!==n)&&null!==Kt(e,t[St]))return t;if("#"===n&&t.id===e.substr(1))return t}return!1},Vt=function(t,e,n){t.addEventListener(e,n,!1)},Zt=function(t,e,n){t.removeEventListener(e,n,!1)},_t=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},te=document[At]("*"),ee=function(t,e,n,i){for(var o=i&&i[kt]?i:te,a=0;a<o[kt];a++){var l=o[a][wt](n),r=t.replace(/spy/i,"").toLowerCase();(l&&t===u&&l[Dt](r)>-1||l===r)&&new e(o[a])}},ne=function(e){var n=e&&(e.currentStyle||t.getComputedStyle(e)),i=/px/.test(n.borderTopWidth)?Math.round(n.borderTopWidth.replace("px","")):0,o=/px/.test(n.borderBottomWidth)?Math.round(n.borderBottomWidth.replace("px","")):0,a=/px/.test(n.marginTop)?Math.round(n.marginTop.replace("px","")):0,l=/px/.test(n.marginBottom)?Math.round(n.marginBottom.replace("px","")):0;return e[_]+parseInt(i)+parseInt(o)+parseInt(a)+parseInt(l)},ie=function(t){for(var e=0,n=0,i=t.children[kt];n<i;n++)e+=ne(t.children[n]);return e},oe=function(n){var i=n[Lt]();return i[jt]>=0&&i[Pt]>=0&&i[zt]<=(t[it]||e[_])&&i[Rt]<=(t[nt]||e[Z])},ae=function(){return{y:t.pageYOffset||e[Q],x:t.pageXOffset||e[V]}},le=function(t,e,i,o){var a=t[Lt](),l=o===n?ae():{x:o[K]+o[V],y:o[G]+o[Q]},r={w:a[Rt]-a[Pt],h:a[zt]-a[jt]},s={w:e[tt],h:e[et]};i===jt?(e.style[jt]=a[jt]+l.y-s.h+"px",e.style[Pt]=a[Pt]+l.x-s.w/2+r.w/2+"px"):i===zt?(e.style[jt]=a[jt]+l.y+r.h+"px",e.style[Pt]=a[Pt]+l.x-s.w/2+r.w/2+"px"):i===Pt?(e.style[jt]=a[jt]+l.y-s.h/2+r.h/2+"px",e.style[Pt]=a[Pt]+l.x-s.w+"px"):i===Rt&&(e.style[jt]=a[jt]+l.y-s.h/2+r.h/2+"px",e.style[Pt]=a[Pt]+l.x+r.w+"px"),e.className[Dt](i)===-1&&(e.className=e.className.replace(qt,i))},re=function(t){return t===jt?zt:t===zt?jt:t===Pt?Rt:t===Rt?Pt:t},se=function(o,a){o=Kt(o),a=a||{};var l=o[wt](w),r=o[wt](N),c=o[wt](W),u="affix",f="affixed",d="function",h="update",p="affix-top",m="affixed-top",v="affix-bottom",g="affixed-bottom";if(this[O]=a[O]?Kt(a[O]):Kt(l)||null,this[G]=a[G]?a[G]:parseInt(r)||0,this[J]=a[J]?a[J]:parseInt(c)||0,this[O]||this[G]||this[J]){var y,T,x,b,I,C,A=this,L=i&&i<10?500:50,E=!1,M=!1,D=function(){return Math.max(n[ot],n[et],e[_],e[ot],e[et])},S=function(){return null!==A[O]?A[O][Lt]()[jt]+b:A[G]?parseInt(typeof A[G]===d?A[G]():A[G]||0):void 0},k=function(){if(A[J])return x-o[et]-parseInt(typeof A[J]===d?A[J]():A[J]||0)},H=function(){x=D(),b=parseInt(ae().y,0),y=S(),T=k(),I=parseInt(y)-b<0&&b>parseInt(y),C=parseInt(T)-b<0&&b>parseInt(T)},B=function(){E||Yt(o,u)||(_t.call(o,u,u),_t.call(o,p,u),Ut(o,u),E=!0,_t.call(o,f,u),_t.call(o,m,u))},$=function(){E&&Yt(o,u)&&(Xt(o,u),E=!1)},P=function(){M||Yt(o,v)||(_t.call(o,u,u),_t.call(o,v,u),Ut(o,v),M=!0,_t.call(o,f,u),_t.call(o,g,u))},R=function(){M&&Yt(o,v)&&(Xt(o,v),M=!1)},j=function(){C?(I&&$(),P()):(R(),I?B():$())};this[h]=function(){H(),j()},s in o||(Vt(t,dt,this[h]),Vt(t,ft,function(){setTimeout(function(){A[h]()},L)})),o[s]=this,this[h]()}};ee(s,se,l);var ce=function(t){t=Kt(t);var e=this,n="alert",o=Qt(t,"."+n),l=i&&i<10?0:300,r=function(i){var l=i[O];l=l[Ct](a)?l:l[St],l&&l[Ct](a)&&(o=Qt(l,"."+n),t=Kt("["+a+'="'+n+'"]',o),(t===l||t===l[St])&&o&&e.close())};this.close=function(){o&&t&&Yt(o,Bt)&&(_t.call(o,gt,n),Xt(o,Bt),setTimeout(function(){o&&(_t.call(o,yt,n),Zt(t,st,r),o[St].removeChild(o))},l))},c in t||Vt(t,st,r),t[c]=this};ee(c,ce,a);var ue=function(t,e){t=Kt(t),e=e||null;var n=!1,i="button",o="checked",a="reset",l="LABEL",r="INPUT",s=function(){e&&e!==a&&(e===$t&&(Ut(t,Wt),t[It](Wt,Wt)),t[It](E,t.innerHTML.replace(/^\s+|\s+$/g,"")),t.innerHTML=t[wt]("data-"+e+"-text"))},c=function(){t[wt](E)&&((Yt(t,Wt)||t[wt](Wt)===Wt)&&(Xt(t,Wt),t.removeAttribute(Wt)),t.innerHTML=t[wt](E))},f=function(e){var a=e[O][St],s=e[O].tagName===l?e[O]:a.tagName===l?a:null;if(s){var c=this,u=Jt(c,"btn"),f=s[At](r)[0];if(f){if("checkbox"===f.type&&(f[o]?(Xt(s,Ht),f[wt](o),f.removeAttribute(o),f[o]=!1):(Ut(s,Ht),f[wt](o),f[It](o,o),f[o]=!0),n||(n=!0,_t.call(f,bt,i),_t.call(t,bt,i))),"radio"===f.type&&!n&&!f[o]){Ut(s,Ht),f[It](o,o),f[o]=!0,_t.call(f,bt,i),_t.call(t,bt,i),n=!0;for(var d=0,h=u[kt];d<h;d++){var p=u[d],m=p[At](r)[0];p!==s&&Yt(p,Ht)&&(Xt(p,Ht),m.removeAttribute(o),m[o]=!1,_t.call(m,bt,i))}}setTimeout(function(){n=!1},50)}}};Yt(t,"btn")&&null!==e&&(e!==a?s():c()),Yt(t,"btn-group")&&(u in t||Vt(t,st,f),t[u]=this)};ee(u,ue,o);var fe=function(e,n){e=Kt(e),n=n||{};var o="false"!==e[wt](I)&&(parseInt(e[wt](I))||5e3),a=e[wt](A)===ct||!1,l="true"===e[wt](x)||!1,r=parseInt(e[wt](b))||600,s="carousel",c="paused",u="direction",d="data-slide-to";this[P]=n[P]===!0||l,this[F]=!(n[F]!==ct&&!a)&&ct,this[j]=i&&i<10?0:n[j]||r,n[q]||o?this[q]=parseInt(n[q])||o:this[q]=!1;var h=this,p=e.index=0,m=e.timer=0,v=!1,g=Jt(e,"item"),y=g[kt],T=this[u]=Pt,w=Jt(e,s+"-control"),C=w[0],L=w[1],E=Kt("."+s+"-indicators",e),M=E[At]("LI"),D=function(){h[q]===!1||Yt(e,c)||(Ut(e,c),!v&&clearInterval(m))},S=function(){h[q]!==!1&&Yt(e,c)&&(Xt(e,c),!v&&clearInterval(m),!v&&h.cycle())},k=function(t){if(t.preventDefault(),!v){var e=t[O],n=h.getActiveIndex();if(!e||Yt(e,Ht)||!e[wt](d))return!1;p=parseInt(e[wt](d),10),n<p||0===n&&p===y-1?T=h[u]=Pt:(n>p||n===y-1&&0===p)&&(T=h[u]=Rt),h.slideTo(p)}},H=function(t){if(t.preventDefault(),!v){var e=t.currentTarget||t.srcElement;e===L?(p++,T=h[u]=Pt,p===y-1?p=y-1:p===y&&(p=0)):e===C&&(p--,T=h[u]=Rt,0===p?p=0:p<0&&(p=y-1)),h.slideTo(p)}},B=function(t){if(!v){switch(t.which){case 39:p++,T=h[u]=Pt,p==y-1?p=y-1:p==y&&(p=0);break;case 37:p--,T=h[u]=Rt,0==p?p=0:p<0&&(p=y-1);break;default:return}h.slideTo(p)}},N=function(t){for(var e=0,n=M[kt];e<n;e++)Xt(M[e],Ht);M[t]&&Ut(M[t],Ht)};this.cycle=function(){T=this[u]=Pt,m=setInterval(function(){p++,p=p===y?0:p,h.slideTo(p)},this[q])},this.slideTo=function(t){var n=this.getActiveIndex(),o=T===Pt?"next":"prev";_t.call(e,xt,s,g[t]),v=!0,clearInterval(m),N(t),!Yt(e,"slide")||i&&i<10?(Ut(g[t],Ht),g[t][tt],Xt(g[n],Ht),setTimeout(function(){v=!1,h[q]&&!Yt(e,c)&&h.cycle(),_t.call(e,Tt,s,g[t])},this[j]+100)):(Ut(g[t],o),g[t][tt],Ut(g[t],T),Ut(g[n],T),setTimeout(function(){v=!1,Ut(g[t],Ht),Xt(g[n],Ht),Xt(g[t],o),Xt(g[t],T),Xt(g[n],T),h[q]&&!Yt(e,c)&&h.cycle(),_t.call(e,Tt,s,g[t])},this[j]+100))},this.getActiveIndex=function(){return g[Dt](Jt(e,"item active")[0])||0},f in e||(this[F]&&this[q]&&(Vt(e,Ot[0],D),Vt(e,Ot[1],S),Vt(e,"touchstart",D),Vt(e,"touchend",S)),L&&Vt(L,st,H),C&&Vt(C,st,H),E&&Vt(E,st,k,!1),this[P]===!0&&Vt(t,ut,B,!1)),this.getActiveIndex()<0&&(g[kt]&&Ut(g[0],Ht),M[kt]&&N(0)),this[q]&&this.cycle(),e[f]=this};ee(f,fe,r);var de=function(t,e){t=Kt(t),e=e||{},e.duration=parseInt(e.duration||t[wt](b)),this[j]=i&&i<10?0:e.duration||300;var n=null,o=null,a=this,l=!1,r=t[wt]("data-parent"),s="collapse",c="collapsed",u=function(t){_t.call(t,ht,s),l=!0,Xt(t,s),Ut(t,Nt),t.style[at]="0px",setTimeout(function(){t.style[at]=ie(t)+"px"},10),setTimeout(function(){Xt(t,Nt),Ut(t,s),Ut(t,Bt),t.style[at]="",l=!1,t[It](lt,"true"),_t.call(t,pt,s)},a[j])},f=function(t){_t.call(t,mt,s),l=!0,Xt(t,s),t.style[at]=ie(t)+"px",setTimeout(function(){Ut(t,Nt),t.style[at]="0px"},10),setTimeout(function(){Xt(t,Nt),Xt(t,Bt),Ut(t,s),t.style[at]="",l=!1,t[It](lt,"false"),_t.call(t,vt,s)},a[j])},h=function(){var e=t.href&&t[wt]("href"),n=t[wt](w),i=e||n&&/#/.test(n)&&n;return i&&Kt(i)};this.toggle=function(t){t.preventDefault(),l||(Yt(o,Bt)?a.hide():a.show())},this.hide=function(){f(o),Ut(t,c)},this.show=function(){if(u(o),Xt(t,c),null!==n)for(var e=Jt(n,s+" "+Bt),i=0,a=e[kt];i<a;i++)e[i]!==o&&f(e[i])},d in t||Vt(t,st,this.toggle),o=h(),n=Kt(e.parent)||r&&Qt(t,r),t[d]=this};ee(d,de,o);var he=function(t,e){t=Kt(t),this.persist=e===!0||"true"===t[wt]("data-persist")||!1;var n=this,i=!1,a=t[St],l="dropdown",r="open",s=null,c=Kt(".dropdown-menu",a),u=Gt(c[At]("*")),f=function(t){!i||27!=t.which&&27!=t.keyCode||(s=null,m())},d=function(e){var l,r=e[O];if(r&&r[St]){if(l=r[wt](o)||r[St][wt](o),r===t||r===a||r[St]===t)e.preventDefault(),s=t,n.toggle();else if(i){if((r===c||u&&u[Dt](r)>-1)&&(n.persist||l))return;s=null,m()}(/\#$/.test(r.href)||/\#$/.test(r[St].href))&&e.preventDefault()}},p=function(){_t.call(a,ht,l,s),Ut(a,r),c[It](lt,!0),_t.call(a,pt,l,s),Vt(document,ut,f),i=!0},m=function(){_t.call(a,mt,l,s),Xt(a,r),c[It](lt,!1),_t.call(a,vt,l,s),Zt(document,ut,f),i=!1};this.toggle=function(){Yt(a,r)&&i?m():p()},h in t||(c[It]("tabindex","0"),Vt(document,st,d)),t[h]=this};ee(h,he,o);var pe=function(o,l){o=Kt(o);var r=o[wt](w)||o[wt]("href"),s=Kt(r),c=Yt(o,"modal")?o:s,u="modal",f="static",d="paddingLeft",h="paddingRight",m="modal-backdrop";if(Yt(o,"modal")&&(o=null),c){l=l||{},this[P]=l[P]!==!1&&"false"!==c[wt](x),this[$]=l[$]!==f&&c[wt](T)!==f||f,this[$]=l[$]!==!1&&"false"!==c[wt](T)&&this[$],this[j]=i&&i<10?50:l[j]||parseInt(c[wt](b))||300,this[z]=l[z];var v,g,y,I,C=this,A=this.open=!1,L=null,E=function(){var n=e[Lt]();return t[nt]||n[Rt]-Math.abs(n[Pt])},M=function(){var e=n.currentStyle||t.getComputedStyle(n),i=parseInt(e[h],10);v&&(n.style[h]=i+y+"px")},D=function(){n.style[h]=""},S=function(){var t,e=document.createElement("div");return e.className=u+"-scrollbar-measure",n.appendChild(e),t=e[tt]-e[Z],n.removeChild(e),t},k=function(){v=n[Z]<E(),g=c[ot]>e[_],y=S()},H=function(){c.style[d]=!v&&g?y+"px":"",c.style[h]=v&&!g?y+"px":""},B=function(){c.style[d]="",c.style[h]=""},N=function(){var t=document.createElement("div");I=Kt("."+m),null===I&&(t[It]("class",m+" fade"),I=t,n.appendChild(I))},W=function(){I=Kt("."+m),I&&null!==I&&"object"==typeof I&&(n.removeChild(I),I=null)},R=function(){Yt(c,Bt)?Zt(document,ut,X):Vt(document,ut,X)},q=function(){Yt(c,Bt)?Zt(t,ft,C.update):Vt(t,ft,C.update)},F=function(){Yt(c,Bt)?Zt(c,st,Y):Vt(c,st,Y)},U=function(t){var e=t[O];e=e[Ct](w)||e[Ct]("href")?e:e[St],A||e!==o||Yt(c,Bt)||(c.modalTrigger=o,L=o,C.show(),t.preventDefault())},X=function(t){var e=t.which||t.keyCode;C[P]&&27==e&&A&&C.hide()},Y=function(t){var e=t[O];A&&(e[St][wt](a)===u||e[wt](a)===u||e===c&&C[$]!==f)&&(C.hide(),L=null,t.preventDefault())};this.toggle=function(){A&&Yt(c,Bt)?this.hide():this.show()},this.show=function(){_t.call(c,ht,u,L);var t=Jt(document,u+" in")[0];t&&t!==c&&t.modalTrigger[p].hide(),this[$]&&N(),I&&!Yt(I,Bt)&&setTimeout(function(){Ut(I,Bt)},0),setTimeout(function(){c.style.display="block",k(),M(),H(),q(),F(),R(),Ut(n,u+"-open"),Ut(c,Bt),c[It](rt,!1)},this[j]/2),setTimeout(function(){A=C.open=!0,Ft(c),_t.call(c,pt,u,L)},this[j])},this.hide=function(){_t.call(c,mt,u),I=Kt("."+m),null!==I&&Xt(I,Bt),Xt(c,Bt),c[It](rt,!0),setTimeout(function(){Xt(n,u+"-open"),q(),F(),R(),B(),D(),c.style.display=""},this[j]/2),setTimeout(function(){Jt(document,u+" "+Bt)[0]||W(),A=C.open=!1,o&&Ft(o),_t.call(c,vt,u)},this[j])},this.setContent=function(t){Kt("."+u+"-content",c).innerHTML=t},this.update=function(){A&&(k(),M(),H())},!o||p in o||Vt(o,st,U),this[z]&&this.setContent(this[z]),!!o&&(o[p]=this)}};ee(p,pe,o);var me=function(e,o){e=Kt(e);var a=e[wt](D),l=e[wt](S),r=e[wt](b),s=e[wt](H),c=e[wt](M),u=e[wt](B),f=e[wt](k),d="popover",h="template",p="trigger",v="class",g="div",y="fade",T="data-title",x="data-content",w="dismissible",I='<button type="button" class="close">×</button>';o=o||{},this[h]=o[h]?o[h]:null,this[p]=o[p]?o[p]:a||ct,this[U]=o[U]&&o[U]!==y?o[U]:l||y,this[X]=o[X]?o[X]:s||jt,this[R]=parseInt(o[R]||u)||100,this[w]=!(!o[w]&&"true"!==c),this[j]=i&&i<10?0:parseInt(o[j]||r)||150,this[Y]=Kt(o[Y])||Kt(f)||n;var C=this,A=e[wt](T)||null,L=e[wt](x)||null;if(L||this[h]){var E=null,N=0,W=this[X],$=function(t){null!==E&&t[O]===Kt(".close",E)&&C.hide()},P=function(){C[Y].removeChild(E),N=null,E=null},z=function(){if(A=e[wt](T),L=e[wt](x),E=document.createElement(g),null!==L&&null===C[h]){if(E[It]("role","tooltip"),null!==A){var t=document.createElement("h3");t[It](v,d+"-title"),t.innerHTML=C[w]?A+I:A,E.appendChild(t)}var n=document.createElement(g),i=document.createElement(g);n[It](v,"arrow"),i[It](v,d+"-content"),E.appendChild(n),E.appendChild(i),i.innerHTML=C[w]&&null===A?L+I:L}else{var o=document.createElement(g);o.innerHTML=C[h],E.innerHTML=o.firstChild.innerHTML}C[Y].appendChild(E),E.style.display="block",E[It](v,d+" "+W+" "+C[U])},q=function(){!Yt(E,Bt)&&Ut(E,Bt)},F=function(){le(e,E,W,C[Y]),oe(E)||(W=re(W),le(e,E,W,C[Y]))};this.toggle=function(){null===E?C.show():C.hide()},this.show=function(){clearTimeout(N),N=setTimeout(function(){null===E&&(W=C[X],z(),F(),q(),_t.call(e,ht,d),setTimeout(function(){_t.call(e,pt,d)},C[j]))},20)},this.hide=function(){clearTimeout(N),N=setTimeout(function(){E&&null!==E&&Yt(E,Bt)&&(_t.call(e,mt,d),Xt(E,Bt),setTimeout(function(){P(),_t.call(e,vt,d)},C[j]))},C[R])},m in e||(C[p]===ct?(Vt(e,Ot[0],C.show),C[w]||Vt(e,Ot[1],C.hide)):/^(click|focus)$/.test(C[p])&&(Vt(e,C[p],C.toggle),C[w]||Vt(e,"blur",C.hide)),C[w]&&Vt(document,st,$),i&&i<9||Vt(t,ft,C.hide)),e[m]=C}};ee(m,me,o);var ve=function(e,n){e=Kt(e);var o=Kt(e[wt](w));if(n=n||{},n[O]||o){for(var a,l=n[O]&&Kt(n[O])||o,r=l&&l[At]("A"),s=[],c=[],u=e[et]<e[ot]?e:t,f=u===t,d=0,h=r[kt];d<h;d++){var p=r[d][wt]("href"),m=p&&/#[a-z0-9]+$/i.test(p)&&Kt(p);m&&(s.push(r[d]),c.push(m))}var g=function(t){var n=s[t][St],i=c[t],o=Qt(n,".dropdown"),l=f&&i[Lt](),r=Yt(n,Ht)||!1,u=f?l[jt]+a:i[G]-(c[t-1]?0:10),d=f?l[zt]+a:c[t+1]?c[t+1][G]:e[ot],h=a>=u&&d>a;if(!r&&h)"LI"!==n.tagName||Yt(n,Ht)||(Ut(n,Ht),r=!0,o&&!Yt(o,Ht)&&Ut(o,Ht),_t.call(e,"activate","scrollspy",s[t]));else if(h){if(!h&&!r||r&&h)return}else"LI"===n.tagName&&Yt(n,Ht)&&(Xt(n,Ht),r=!1,o&&Yt(o,Ht)&&!Jt(n[St],Ht).length&&Xt(o,Ht))},y=function(){a=f?ae().y:e[Q];for(var t=0,n=s[kt];t<n;t++)g(t)};this.refresh=function(){y()},v in e||(Vt(u,dt,this.refresh),i&&i<9||Vt(t,ft,this.refresh)),this.refresh(),e[v]=this}};ee(v,ve,l);var ge=function(t,e){t=Kt(t);var n=t[wt](b),o=t[wt](C),a="tab",l="height",r="isAnimating";t[r]=!1,e=e||{},this[j]=i&&i<10?0:parseInt(e[j]||n)||150,this[l]=!(i&&i<10)&&(e[l]||"true"===o||!1);var s,c,u=this,f=Qt(t,".nav"),d=Kt(".dropdown",f),h=function(){var t,e=Jt(f,Ht);return 1!==e[kt]||Yt(e[0],"dropdown")?e[kt]>1&&(t=e[e[kt]-1]):t=e[0],t[At]("A")[0]},p=function(){return Kt(h()[wt]("href"))},m=function(t){t.preventDefault(),s=t[O],u.show()};this.show=function(){var e=Kt(s[wt]("href")),n=h(),i=p();n[r]&&s[r]||Yt(s[St],Ht)||(n[r]=s[r]=!0,Xt(n[St],Ht),Ut(s[St],Ht),d&&(Yt(t[St][St],"dropdown-menu")?Yt(d,Ht)||Ut(d,Ht):Yt(d,Ht)&&Xt(d,Ht)),c&&(c.style[l]=ie(i)+"px"),_t.call(n,mt,a,s),setTimeout(function(){Xt(i,Bt)},10),setTimeout(function(){c&&Ut(c,Nt),Xt(i,Ht),Ut(e,Ht),setTimeout(function(){Ut(e,Bt)},10),_t.call(s,ht,a,n),_t.call(n,vt,a,s),c&&(c.style[l]=ie(e)+"px")},.7*u[j]),setTimeout(function(){_t.call(s,pt,a,n),c&&(Xt(c,Nt),c.style[l]=""),n[r]=s[r]=!1},1.5*u[j]))},g in t||Vt(t,st,m),this[l]&&(c=p()[St]),t[g]=this};ee(g,ge,o);var ye=function(t,e){t=Kt(t);var o=t[wt](S);placementData=t[wt](H),durationData=t[wt](b),delayData=t[wt](B),containerData=t[wt](k),component="tooltip",classString="class",title="title",fade="fade",div="div",e=e||{},this[U]=e[U]&&e[U]!==fade?e[U]:o||fade,this[X]=e[X]?e[X]:placementData||jt,this[R]=parseInt(e[R]||delayData)||100,this[j]=i&&i<10?0:parseInt(e[j]||durationData)||150,this[Y]=Kt(e[Y])||Kt(containerData)||n;var a=this,l=0,r=this[X],s=null,c=t[wt](title)||t[wt](L);if(c){var u=function(){a[Y].removeChild(s),s=null,l=null},f=function(){c=t[wt](title)||t[wt](L),s=document.createElement(div),s[It]("role",component);var e=document.createElement(div),n=document.createElement(div);e[It](classString,component+"-arrow"),n[It](classString,component+"-inner"),s.appendChild(e),s.appendChild(n),n.innerHTML=c,a[Y].appendChild(s),s[It](classString,component+" "+r+" "+a[U])},d=function(){le(t,s,r,a[Y]),oe(s)||(r=re(r),le(t,s,r,a[Y]))},h=function(){!Yt(s,Bt)&&Ut(s,Bt)};this.show=function(){clearTimeout(l),l=setTimeout(function(){null===s&&(r=a[X],f(),d(),h(),_t.call(t,ht,component),setTimeout(function(){_t.call(t,pt,component)},a[j]))},20)},this.hide=function(){clearTimeout(l),l=setTimeout(function(){s&&null!==s&&Yt(s,Bt)&&(_t.call(t,mt,component),Xt(s,Bt),setTimeout(function(){u(),_t.call(t,vt,component)},a[j]))},a[R])},this.toggle=function(){s?a.hide():a.show()},y in t||(t[It](L,c),t.removeAttribute(title),Vt(t,Ot[0],this.show),Vt(t,Ot[1],this.hide)),t[y]=this}};return ee(y,ye,o),{Affix:se,Alert:ce,Button:ue,Carousel:fe,Collapse:de,Dropdown:he,Modal:pe,Popover:me,ScrollSpy:ve,Tab:ge,Tooltip:ye}}); | ||
// Native Javascript for Bootstrap 3 v2.0.4 | © dnp_theme | MIT-License | ||
!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();t.Affix=n.Affix,t.Alert=n.Alert,t.Button=n.Button,t.Carousel=n.Carousel,t.Collapse=n.Collapse,t.Dropdown=n.Dropdown,t.Modal=n.Modal,t.Popover=n.Popover,t.ScrollSpy=n.ScrollSpy,t.Tab=n.Tab,t.Tooltip=n.Tooltip}}(this,function(){var t="undefined"!=typeof global?global:this||window,e=document.documentElement,n=document.body,i=null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)&&parseFloat(RegExp.$1),o="data-toggle",a="data-dismiss",l="data-spy",r="data-ride",c="Affix",u="Alert",s="Button",f="Carousel",d="Collapse",h="Dropdown",p="Modal",m="Popover",v="ScrollSpy",g="Tab",x="Tooltip",T="data-backdrop",b="data-keyboard",y="data-target",w="data-interval",C="data-height",I="data-pause",A="data-original-title",L="data-original-text",E="data-dismissible",M="data-trigger",S="data-animation",D="data-container",k="data-placement",H="data-delay",B="data-offset-top",N="data-offset-bottom",W="backdrop",$="keyboard",P="delay",R="duration",j="content",z="target",O="interval",q="pause",F="animation",U="placement",X="container",Y="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",mt="hidden",vt="close",gt="closed",xt="slid",Tt="slide",bt="change",yt="getAttribute",wt="setAttribute",Ct="hasAttribute",It="getElementsByTagName",At="getBoundingClientRect",Lt="querySelectorAll",Et="getElementsByClassName",Mt="indexOf",St="parentNode",Dt="length",kt="toLowerCase",Ht="Transition",Bt="Webkit",Nt="style",Wt="active",$t="in",Pt="collapsing",Rt="disabled",jt="loading",zt="left",Ot="right",qt="top",Ft="bottom",Ut="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Xt=/\b(top|bottom|left|top)+/,Yt=Bt+Ht in e[Nt]||Ht[kt]()in e[Nt],Gt=Bt+Ht in e[Nt]?Bt[kt]()+Ht+"End":Ht[kt]()+"end",Jt=function(t){t.focus?t.focus():t.setActive()},Kt=function(t,e){t.classList.add(e)},Qt=function(t,e){t.classList.remove(e)},Vt=function(t,e){return t.classList.contains(e)},Zt=function(t){for(var e=[],n=0,i=t[Dt];n<i;n++)e.push(t[n]);return e},_t=function(t,e){var n=8===i?Lt:Et;return Zt(t[n](8===i?"."+e.replace(/\s(?=[a-z])/g,"."):e))},te=function(t,e){var n=e?e:document;return"object"==typeof t?t:n.querySelector(t)},ee=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t[St]){if(("."===n||"#"!==n)&&null!==te(e,t[St]))return t;if("#"===n&&t.id===e.substr(1))return t}return!1},ne=function(t,e,n){t.addEventListener(e,n,!1)},ie=function(t,e,n){t.removeEventListener(e,n,!1)},oe=function(t,e,n){ne(t,e,function i(){n(),ie(t,e,i)})},ae=function(t,e){Yt?oe(t,Gt,e):e()},le=function(t,e,n){var i=new CustomEvent(t+".bs."+e);i.relatedTarget=n,this.dispatchEvent(i)},re=document[It]("*"),ce=function(t,e,n,i){for(var o=i&&i[Dt]?i:re,a=0;a<o[Dt];a++){var l=o[a][yt](n),r=t.replace(/spy/i,"")[kt]();(l&&t===s&&l[Mt](r)>-1||l===r)&&new e(o[a])}},ue=function(e){var n=e&&(e.currentStyle||t.getComputedStyle(e)),i=/px/.test(n.borderTopWidth)?Math.round(n.borderTopWidth.replace("px","")):0,o=/px/.test(n.borderBottomWidth)?Math.round(n.borderBottomWidth.replace("px","")):0,a=/px/.test(n.marginTop)?Math.round(n.marginTop.replace("px","")):0,l=/px/.test(n.marginBottom)?Math.round(n.marginBottom.replace("px","")):0;return e[Z]+parseInt(i)+parseInt(o)+parseInt(a)+parseInt(l)},se=function(t){for(var e=0,n=0,i=t.children[Dt];n<i;n++)e+=ue(t.children[n]);return e},fe=function(n){var i=n[At]();return i[qt]>=0&&i[zt]>=0&&i[Ft]<=(t[nt]||e[Z])&&i[Ot]<=(t[et]||e[V])},de=function(){return{y:t.pageYOffset||e[K],x:t.pageXOffset||e[Q]}},he=function(t,e,i,o){var a=t[At](),l=o===n?de():{x:o[J]+o[Q],y:o[Y]+o[K]},r={w:a[Ot]-a[zt],h:a[Ft]-a[qt]},c={w:e[_],h:e[tt]};i===qt?(e[Nt][qt]=a[qt]+l.y-c.h+"px",e[Nt][zt]=a[zt]+l.x-c.w/2+r.w/2+"px"):i===Ft?(e[Nt][qt]=a[qt]+l.y+r.h+"px",e[Nt][zt]=a[zt]+l.x-c.w/2+r.w/2+"px"):i===zt?(e[Nt][qt]=a[qt]+l.y-c.h/2+r.h/2+"px",e[Nt][zt]=a[zt]+l.x-c.w+"px"):i===Ot&&(e[Nt][qt]=a[qt]+l.y-c.h/2+r.h/2+"px",e[Nt][zt]=a[zt]+l.x+r.w+"px"),e.className[Mt](i)===-1&&(e.className=e.className.replace(Xt,i))},pe=function(t){return t===qt?Ft:t===Ft?qt:t===zt?Ot:t===Ot?zt:t},me=function(o,a){o=te(o),a=a||{};var l=o[yt](y),r=o[yt](B),u=o[yt](N),s="affix",f="affixed",d="function",h="update",p="affix-top",m="affixed-top",v="affix-bottom",g="affixed-bottom";if(this[z]=a[z]?te(a[z]):te(l)||null,this[Y]=a[Y]?a[Y]:parseInt(r)||0,this[G]=a[G]?a[G]:parseInt(u)||0,this[z]||this[Y]||this[G]){var x,T,b,w,C,I,A=this,L=i&&i<10?500:50,E=!1,M=!1,S=function(){return Math.max(n[it],n[tt],e[Z],e[it],e[tt])},D=function(){return null!==A[z]?A[z][At]()[qt]+w:A[Y]?parseInt(typeof A[Y]===d?A[Y]():A[Y]||0):void 0},k=function(){if(A[G])return b-o[tt]-parseInt(typeof A[G]===d?A[G]():A[G]||0)},H=function(){b=S(),w=parseInt(de().y,0),x=D(),T=k(),C=parseInt(x)-w<0&&w>parseInt(x),I=parseInt(T)-w<0&&w>parseInt(T)},W=function(){E||Vt(o,s)||(le.call(o,s,s),le.call(o,p,s),Kt(o,s),E=!0,le.call(o,f,s),le.call(o,m,s))},$=function(){E&&Vt(o,s)&&(Qt(o,s),E=!1)},P=function(){M||Vt(o,v)||(le.call(o,s,s),le.call(o,v,s),Kt(o,v),M=!0,le.call(o,f,s),le.call(o,g,s))},R=function(){M&&Vt(o,v)&&(Qt(o,v),M=!1)},j=function(){I?(C&&$(),P()):(R(),C?W():$())};this[h]=function(){H(),j()},c in o||(ne(t,ft,this[h]),ne(t,st,function(){setTimeout(function(){A[h]()},L)})),o[c]=this,this[h]()}};ce(c,me,l);var ve=function(t){t=te(t);var e=this,n="alert",i=ee(t,"."+n),o=function(o){var l=o[z];l=l[Ct](a)?l:l[St],l&&l[Ct](a)&&(i=ee(l,"."+n),t=te("["+a+'="'+n+'"]',i),(t===l||t===l[St])&&i&&e.close())},l=function(){le.call(i,gt,n),ie(t,rt,o),i[St].removeChild(i)};this.close=function(){i&&t&&Vt(i,$t)&&(le.call(i,vt,n),Qt(i,$t),setTimeout(function(){i&&ae(i,l)},R))},u in t||ne(t,rt,o),t[u]=this};ce(u,ve,a);var ge=function(t,e){t=te(t),e=e||null;var n=!1,i="button",o="checked",a="reset",l="LABEL",r="INPUT",c=function(){e&&e!==a&&(e===jt&&(Kt(t,Rt),t[wt](Rt,Rt)),t[wt](L,t.innerHTML.replace(/^\s+|\s+$/g,"")),t.innerHTML=t[yt]("data-"+e+"-text"))},u=function(){t[yt](L)&&((Vt(t,Rt)||t[yt](Rt)===Rt)&&(Qt(t,Rt),t.removeAttribute(Rt)),t.innerHTML=t[yt](L))},f=function(e){var a=e[z][St],c=e[z].tagName===l?e[z]:a.tagName===l?a:null;if(c){var u=this,s=_t(u,"btn"),f=c[It](r)[0];if(f){if("checkbox"===f.type&&(f[o]?(Qt(c,Wt),f[yt](o),f.removeAttribute(o),f[o]=!1):(Kt(c,Wt),f[yt](o),f[wt](o,o),f[o]=!0),n||(n=!0,le.call(f,bt,i),le.call(t,bt,i))),"radio"===f.type&&!n&&!f[o]){Kt(c,Wt),f[wt](o,o),f[o]=!0,le.call(f,bt,i),le.call(t,bt,i),n=!0;for(var d=0,h=s[Dt];d<h;d++){var p=s[d],m=p[It](r)[0];p!==c&&Vt(p,Wt)&&(Qt(p,Wt),m.removeAttribute(o),m[o]=!1,le.call(m,bt,i))}}setTimeout(function(){n=!1},50)}}};Vt(t,"btn")&&null!==e&&(e!==a?c():u()),Vt(t,"btn-group")&&(s in t||ne(t,rt,f),t[s]=this)};ce(s,ge,o);var xe=function(e,n){e=te(e),n=n||{};var i="false"!==e[yt](w)&&(parseInt(e[yt](w))||5e3),o=e[yt](I)===ct||!1,a="true"===e[yt](b)||!1,l="carousel",r="paused",c="direction",u="data-slide-to";this[$]=n[$]===!0||a,this[q]=!(n[q]!==ct&&!o)&&ct,n[O]||i?this[O]=parseInt(n[O])||i:this[O]=!1;var s=this,d=e.index=0,h=e.timer=0,p=!1,m=_t(e,"item"),v=m[Dt],g=this[c]=zt,x=_t(e,l+"-control"),T=x[0],y=x[1],C=te("."+l+"-indicators",e),A=C[It]("LI"),L=function(){s[O]===!1||Vt(e,r)||(Kt(e,r),!p&&clearInterval(h))},E=function(){s[O]!==!1&&Vt(e,r)&&(Qt(e,r),!p&&clearInterval(h),!p&&s.cycle())},M=function(t){if(t.preventDefault(),!p){var e=t[z],n=s.getActiveIndex();if(!e||Vt(e,Wt)||!e[yt](u))return!1;d=parseInt(e[yt](u),10),n<d||0===n&&d===v-1?g=s[c]=zt:(n>d||n===v-1&&0===d)&&(g=s[c]=Ot),s.slideTo(d)}},S=function(t){if(t.preventDefault(),!p){var e=t.currentTarget||t.srcElement;e===y?(d++,g=s[c]=zt,d===v-1?d=v-1:d===v&&(d=0)):e===T&&(d--,g=s[c]=Ot,0===d?d=0:d<0&&(d=v-1)),s.slideTo(d)}},D=function(t){if(!p){switch(t.which){case 39:d++,g=s[c]=zt,d==v-1?d=v-1:d==v&&(d=0);break;case 37:d--,g=s[c]=Ot,0==d?d=0:d<0&&(d=v-1);break;default:return}s.slideTo(d)}},k=function(t){for(var e=0,n=A[Dt];e<n;e++)Qt(A[e],Wt);A[t]&&Kt(A[t],Wt)};this.cycle=function(){g=this[c]=zt,h=setInterval(function(){d++,d=d===v?0:d,s.slideTo(d)},this[O])},this.slideTo=function(t){var n=this.getActiveIndex(),i=g===zt?"next":"prev";le.call(e,Tt,l,m[t]),p=this.isSliding=!0,clearInterval(h),k(t),Yt&&Vt(e,"slide")?(Kt(m[t],i),m[t][_],Kt(m[t],g),Kt(m[n],g),oe(m[t],Gt,function(){p=s.isSliding=!1,Kt(m[t],Wt),Qt(m[n],Wt),Qt(m[t],i),Qt(m[t],g),Qt(m[n],g),s[O]&&!Vt(e,r)&&s.cycle(),le.call(e,xt,l,m[t])})):(Kt(m[t],Wt),m[t][_],Qt(m[n],Wt),setTimeout(function(){p=!1,s[O]&&!Vt(e,r)&&s.cycle(),le.call(e,xt,l,m[t])},100))},this.getActiveIndex=function(){return m[Mt](_t(e,"item active")[0])||0},f in e||(this[q]&&this[O]&&(ne(e,Ut[0],L),ne(e,Ut[1],E),ne(e,"touchstart",L),ne(e,"touchend",E)),y&&ne(y,rt,S),T&&ne(T,rt,S),C&&ne(C,rt,M,!1),this[$]===!0&&ne(t,ut,D,!1)),this.getActiveIndex()<0&&(m[Dt]&&Kt(m[0],Wt),A[Dt]&&k(0)),this[O]&&this.cycle(),e[f]=this};ce(f,xe,r);var Te=function(t,e){t=te(t),e=e||{};var n=null,i=null,o=this,a=!1,l=t[yt]("data-parent"),r="collapse",c="collapsed",u=function(t){le.call(t,dt,r),a=!0,Kt(t,Pt),Kt(t,$t),setTimeout(function(){t[Nt][ot]=se(t)+"px"},0),ae(t,function(){Qt(t,Pt),t[Nt][ot]="",a=!1,t[wt](at,"true"),le.call(t,ht,r)})},s=function(t){le.call(t,pt,r),a=!0,t[Nt][ot]=se(t)+"px",setTimeout(function(){Kt(t,Pt),t[Nt][ot]="0px"},0),ae(t,function(){Qt(t,Pt),Qt(t,$t),t[Nt][ot]="",a=!1,t[wt](at,"false"),le.call(t,mt,r)})},f=function(){var e=t.href&&t[yt]("href"),n=t[yt](y),i=e||n&&/#/.test(n)&&n;return i&&te(i)};this.toggle=function(t){t.preventDefault(),a||(Vt(i,$t)?o.hide():o.show())},this.hide=function(){s(i),Kt(t,c)},this.show=function(){if(u(i),Qt(t,c),null!==n)for(var e=_t(n,r+" "+$t),o=0,a=e[Dt];o<a;o++)e[o]!==i&&s(e[o])},d in t||ne(t,rt,this.toggle),i=f(),n=te(e.parent)||l&&ee(t,l),t[d]=this};ce(d,Te,o);var be=function(t,e){t=te(t),this.persist=e===!0||"true"===t[yt]("data-persist")||!1;var n=this,i=!1,a=t[St],l="dropdown",r="open",c=null,u=te(".dropdown-menu",a),s=Zt(u[It]("*")),f=function(t){!i||27!=t.which&&27!=t.keyCode||(c=null,m())},d=function(e){var l,r=e[z];if(l=1!==r.nodeType&&(r[yt](o)||r[St][yt](o)),r===t||r===a||r[St]===t)e.preventDefault(),c=t,n.toggle();else if(i){if((r===u||s&&s[Mt](r)>-1)&&(n.persist||l))return;c=null,m()}(/\#$/.test(r.href)||r[St]&&/\#$/.test(r[St].href))&&e.preventDefault()},p=function(){le.call(a,dt,l,c),Kt(a,r),u[wt](at,!0),le.call(a,ht,l,c),ne(document,ut,f),i=!0},m=function(){le.call(a,pt,l,c),Qt(a,r),u[wt](at,!1),le.call(a,mt,l,c),ie(document,ut,f),i=!1};this.toggle=function(){Vt(a,r)&&i?m():p()},h in t||(u[wt]("tabindex","0"),ne(document,rt,d)),t[h]=this};ce(h,be,o);var ye=function(i,o){i=te(i);var l=i[yt](y)||i[yt]("href"),r=te(l),c=Vt(i,"modal")?i:r,u="modal",s="static",f="paddingLeft",d="paddingRight",h="modal-backdrop";if(Vt(i,"modal")&&(i=null),c){o=o||{},this[$]=o[$]!==!1&&"false"!==c[yt](b),this[W]=o[W]!==s&&c[yt](T)!==s||s,this[W]=o[W]!==!1&&"false"!==c[yt](T)&&this[W],this[j]=o[j];var m,v,g,x,w=this,C=this.open=!1,I=null,A=function(){var n=e[At]();return t[et]||n[Ot]-Math.abs(n[zt])},L=function(){var e=n.currentStyle||t.getComputedStyle(n),i=parseInt(e[d],10);m&&(n[Nt][d]=i+g+"px")},E=function(){n[Nt][d]=""},M=function(){var t,e=document.createElement("div");return e.className=u+"-scrollbar-measure",n.appendChild(e),t=e[_]-e[V],n.removeChild(e),t},S=function(){m=n[V]<A(),v=c[it]>e[Z],g=M()},D=function(){c[Nt][f]=!m&&v?g+"px":"",c[Nt][d]=m&&!v?g+"px":""},k=function(){c[Nt][f]="",c[Nt][d]=""},H=function(){var t=document.createElement("div");x=te("."+h),null===x&&(t[wt]("class",h+" fade"),x=t,n.appendChild(x))},B=function(){x=te("."+h),x&&null!==x&&"object"==typeof x&&(n.removeChild(x),x=null)},N=function(){Vt(c,$t)?ie(document,ut,q):ne(document,ut,q)},P=function(){Vt(c,$t)?ie(t,st,w.update):ne(t,st,w.update)},R=function(){Vt(c,$t)?ie(c,rt,F):ne(c,rt,F)},O=function(t){var e=t[z];e=e[Ct](y)||e[Ct]("href")?e:e[St],C||e!==i||Vt(c,$t)||(c.modalTrigger=i,I=i,w.show(),t.preventDefault())},q=function(t){var e=t.which||t.keyCode;w[$]&&27==e&&C&&w.hide()},F=function(t){var e=t[z];C&&(e[St][yt](a)===u||e[yt](a)===u||e===c&&w[W]!==s)&&(w.hide(),I=null,t.preventDefault())};this.toggle=function(){C&&Vt(c,$t)?this.hide():this.show()},this.show=function(){le.call(c,dt,u,I);var t=_t(document,u+" in")[0];t&&t!==c&&t.modalTrigger[p].hide(),this[W]&&H(),x&&!Vt(x,$t)&&setTimeout(function(){Kt(x,$t)},0),setTimeout(function(){c[Nt].display="block",S(),L(),D(),P(),R(),N(),Kt(n,u+"-open"),Kt(c,$t),c[wt](lt,!1)},0),ae(c,function(){C=w.open=!0,Jt(c),le.call(c,ht,u,I)})},this.hide=function(){le.call(c,pt,u),x=te("."+h),null!==x&&Qt(x,$t),Qt(c,$t),c[wt](lt,!0),ae(c,function(){Qt(n,u+"-open"),P(),R(),N(),k(),E(),c[Nt].display="",_t(document,u+" "+$t)[0]||B(),C=w.open=!1,i&&Jt(i),le.call(c,mt,u)})},this.setContent=function(t){te("."+u+"-content",c).innerHTML=t},this.update=function(){C&&(S(),L(),D())},!i||p in i||ne(i,rt,O),this[j]&&this.setContent(this[j]),!!i&&(i[p]=this)}};ce(p,ye,o);var we=function(e,o){e=te(e);var a=e[yt](M),l=e[yt](S),r=e[yt](k),c=e[yt](E),u=e[yt](H),s=e[yt](D),f="popover",d="template",h="trigger",p="class",v="div",g="fade",x="data-title",T="data-content",b="dismissible",y='<button type="button" class="close">×</button>';o=o||{},this[d]=o[d]?o[d]:null,this[h]=o[h]?o[h]:a||ct,this[F]=o[F]&&o[F]!==g?o[F]:l||g,this[U]=o[U]?o[U]:r||qt,this[P]=parseInt(o[P]||u)||200,this[b]=!(!o[b]&&"true"!==c),this[X]=te(o[X])||te(s)||n;var w=this,C=e[yt](x)||null,I=e[yt](T)||null;if(I||this[d]){var A=null,L=0,B=this[U],N=function(t){null!==A&&t[z]===te(".close",A)&&w.hide()},W=function(){w[X].removeChild(A),L=null,A=null},$=function(){if(C=e[yt](x),I=e[yt](T),A=document.createElement(v),null!==I&&null===w[d]){if(A[wt]("role","tooltip"),null!==C){var t=document.createElement("h3");t[wt](p,f+"-title"),t.innerHTML=w[b]?C+y:C,A.appendChild(t)}var n=document.createElement(v),i=document.createElement(v);n[wt](p,"arrow"),i[wt](p,f+"-content"),A.appendChild(n),A.appendChild(i),i.innerHTML=w[b]&&null===C?I+y:I}else{var o=document.createElement(v);o.innerHTML=w[d],A.innerHTML=o.firstChild.innerHTML}w[X].appendChild(A),A[Nt].display="block",A[wt](p,f+" "+B+" "+w[F])},R=function(){!Vt(A,$t)&&Kt(A,$t)},j=function(){he(e,A,B,w[X]),fe(A)||(B=pe(B),he(e,A,B,w[X]))};this.toggle=function(){null===A?w.show():w.hide()},this.show=function(){clearTimeout(L),L=setTimeout(function(){null===A&&(B=w[U],$(),j(),R(),le.call(e,dt,f),ae(A,function(){le.call(e,ht,f)}))},20)},this.hide=function(){clearTimeout(L),L=setTimeout(function(){A&&null!==A&&Vt(A,$t)&&(le.call(e,pt,f),Qt(A,$t),ae(A,function(){W(),le.call(e,mt,f)}))},w[P])},m in e||(w[h]===ct?(ne(e,Ut[0],w.show),w[b]||ne(e,Ut[1],w.hide)):/^(click|focus)$/.test(w[h])&&(ne(e,w[h],w.toggle),w[b]||ne(e,"blur",w.hide)),w[b]&&ne(document,rt,N),i&&i<9||ne(t,st,w.hide)),e[m]=w}};ce(m,we,o);var Ce=function(e,n){e=te(e);var o=te(e[yt](y));if(n=n||{},n[z]||o){for(var a,l=n[z]&&te(n[z])||o,r=l&&l[It]("A"),c=[],u=[],s=e[tt]<e[it]?e:t,f=s===t,d=0,h=r[Dt];d<h;d++){var p=r[d][yt]("href"),m=p&&/#[a-z0-9]+$/i.test(p)&&te(p);m&&(c.push(r[d]),u.push(m))}var g=function(t){var n=c[t][St],i=u[t],o=ee(n,".dropdown"),l=f&&i[At](),r=Vt(n,Wt)||!1,s=f?l[qt]+a:i[Y]-(u[t-1]?0:10),d=f?l[Ft]+a:u[t+1]?u[t+1][Y]:e[it],h=a>=s&&d>a;if(!r&&h)"LI"!==n.tagName||Vt(n,Wt)||(Kt(n,Wt),r=!0,o&&!Vt(o,Wt)&&Kt(o,Wt),le.call(e,"activate","scrollspy",c[t]));else if(h){if(!h&&!r||r&&h)return}else"LI"===n.tagName&&Vt(n,Wt)&&(Qt(n,Wt),r=!1,o&&Vt(o,Wt)&&!_t(n[St],Wt).length&&Qt(o,Wt))},x=function(){a=f?de().y:e[K];for(var t=0,n=c[Dt];t<n;t++)g(t)};this.refresh=function(){x()},v in e||(ne(s,ft,this.refresh),i&&i<9||ne(t,st,this.refresh)),this.refresh(),e[v]=this}};ce(v,Ce,l);var Ie=function(t,e){t=te(t);var n=t[yt](C),i="tab",o="height",a="isAnimating";t[a]=!1,e=e||{},this[o]=!!Yt&&(e[o]||"true"===n);var l,r,c=this,u=ee(t,".nav"),s=te(".dropdown",u),f=function(){var t,e=_t(u,Wt);return 1!==e[Dt]||Vt(e[0],"dropdown")?e[Dt]>1&&(t=e[e[Dt]-1]):t=e[0],t[It]("A")[0]},d=function(){return te(f()[yt]("href"))},h=function(t){t.preventDefault(),l=t[z],c.show()};this.show=function(){var e=te(l[yt]("href")),n=f(),c=d();n[a]&&l[a]||Vt(l[St],Wt)||(n[a]=l[a]=!0,Qt(n[St],Wt),Kt(l[St],Wt),s&&(Vt(t[St][St],"dropdown-menu")?Vt(s,Wt)||Kt(s,Wt):Vt(s,Wt)&&Qt(s,Wt)),r&&(r[Nt][o]=se(c)+"px"),le.call(n,pt,i,l),setTimeout(function(){Qt(c,$t)},0),ae(c,function(){r&&Kt(r,Pt),Qt(c,Wt),Kt(e,Wt),setTimeout(function(){Kt(e,$t),r&&(r[Nt][o]=se(e)+"px")},0),le.call(l,dt,i,n),le.call(n,mt,i,l)}),ae(e,function(){le.call(l,ht,i,n),r?setTimeout(function(){ae(r,function(){r[Nt][o]="",Qt(r,Pt),n[a]=l[a]=!1})},0):n[a]=l[a]=!1}))},g in t||ne(t,rt,h),this[o]&&(r=d()[St]),t[g]=this};ce(g,Ie,o);var Ae=function(t,e){t=te(t);var i=t[yt](S);placementData=t[yt](k),delayData=t[yt](H),containerData=t[yt](D),component="tooltip",classString="class",title="title",fade="fade",div="div",e=e||{},this[F]=e[F]&&e[F]!==fade?e[F]:i||fade,this[U]=e[U]?e[U]:placementData||qt,this[P]=parseInt(e[P]||delayData)||200,this[X]=te(e[X])||te(containerData)||n;var o=this,a=0,l=this[U],r=null,c=t[yt](title)||t[yt](A);if(c){var u=function(){o[X].removeChild(r),r=null,a=null},s=function(){c=t[yt](title)||t[yt](A),r=document.createElement(div),r[wt]("role",component);var e=document.createElement(div),n=document.createElement(div);e[wt](classString,component+"-arrow"),n[wt](classString,component+"-inner"),r.appendChild(e),r.appendChild(n),n.innerHTML=c,o[X].appendChild(r),r[wt](classString,component+" "+l+" "+o[F])},f=function(){he(t,r,l,o[X]),fe(r)||(l=pe(l),he(t,r,l,o[X]))},d=function(){!Vt(r,$t)&&Kt(r,$t)};this.show=function(){clearTimeout(a),a=setTimeout(function(){null===r&&(l=o[U],s(),f(),d(),le.call(t,dt,component),ae(r,function(){le.call(t,ht,component)}))},20)},this.hide=function(){clearTimeout(a),a=setTimeout(function(){r&&null!==r&&Vt(r,$t)&&(le.call(t,pt,component),Qt(r,$t),ae(r,function(){u(),le.call(t,mt,component)}))},o[P])},this.toggle=function(){r?o.hide():o.show()},x in t||(t[wt](A,c),t.removeAttribute(title),ne(t,Ut[0],this.show),ne(t,Ut[1],this.hide)),t[x]=this}};return ce(x,Ae,o),{Affix:me,Alert:ve,Button:ge,Carousel:xe,Collapse:Te,Dropdown:be,Modal:ye,Popover:we,ScrollSpy:Ce,Tab:Ie,Tooltip:Ae}}); |
@@ -14,4 +14,4 @@ | ||
var self = this, component = 'alert', | ||
alert = getClosest(element,'.'+component), duration = (isIE && isIE < 10) ? 0 : 300, // default alert transition duration | ||
// handler | ||
alert = getClosest(element,'.'+component), | ||
// handlers | ||
clickHandler = function(e){ | ||
@@ -25,2 +25,7 @@ var eventTarget = e[target]; | ||
} | ||
}, | ||
transitionEndHandler = function(){ | ||
bootstrapCustomEvent.call(alert, closedEvent, component); | ||
off(element, clickEvent, clickHandler); // detach it's listener | ||
alert[parentNode].removeChild(alert); | ||
}; | ||
@@ -35,5 +40,3 @@ | ||
if (alert) { | ||
bootstrapCustomEvent.call(alert, closedEvent, component); | ||
off(element, clickEvent, clickHandler); // detach it's listener | ||
alert[parentNode].removeChild(alert); | ||
emulateTransitionEnd(alert,transitionEndHandler); | ||
} | ||
@@ -40,0 +43,0 @@ }, duration); |
@@ -19,3 +19,2 @@ | ||
keyboardData = element[getAttribute](dataKeyboard) === 'true' || false, | ||
durationData = parseInt(element[getAttribute](dataDuration)) || 600, // bootstrap carousel default transition duration | ||
@@ -30,3 +29,2 @@ // strings | ||
this[pause] = (options[pause] === hoverEvent || pauseData) ? hoverEvent : false; // false / hover | ||
this[duration] = (isIE && isIE < 10) ? 0 : options[duration] || durationData; | ||
@@ -154,7 +152,7 @@ if ( !( options[interval] || intervalData ) ) { // determine slide interval | ||
isSliding = true; | ||
isSliding = this.isSliding = true; | ||
clearInterval(timer); | ||
setActivePage( next ); | ||
if ( hasClass(element,'slide') && !(isIE && isIE < 10) ) { | ||
if ( supportTransitions && hasClass(element,'slide') ) { | ||
addClass(slides[next],orientation); | ||
@@ -165,4 +163,4 @@ slides[next][offsetWidth]; | ||
setTimeout(function() { //we're gonna fake waiting for the animation to finish, cleaner and better | ||
isSliding = false; | ||
one(slides[next], transitionEndEvent, function() { //we're gonna fake waiting for the animation to finish, cleaner and better | ||
isSliding = self.isSliding = false; | ||
@@ -180,4 +178,4 @@ addClass(slides[next],active); | ||
bootstrapCustomEvent.call(element, slidEvent, component, slides[next]); // here we go with the slid event | ||
}, this[duration] + 100 ); | ||
}); | ||
} else { | ||
@@ -193,3 +191,3 @@ addClass(slides[next],active); | ||
bootstrapCustomEvent.call(element, slidEvent, component, slides[next]); // here we go with the slid event | ||
}, this[duration] + 100 ); | ||
}, 100 ); | ||
} | ||
@@ -196,0 +194,0 @@ }; |
@@ -14,5 +14,3 @@ | ||
options = options || {}; | ||
options.duration = parseInt(options.duration || element[getAttribute](dataDuration)); | ||
this[duration] = (isIE && isIE < 10) ? 0 : (options.duration || 300); // default collapse transition duration | ||
@@ -32,17 +30,15 @@ // event targets and constants | ||
isAnimating = true; | ||
removeClass(collapseElement,component); | ||
addClass(collapseElement,collapsing); | ||
collapseElement.style[height] = '0px'; | ||
addClass(collapseElement,inClass); | ||
setTimeout(function() { | ||
collapseElement.style[height] = getMaxHeight(collapseElement) + 'px'; | ||
}, 10); | ||
setTimeout(function() { | ||
collapseElement[style][height] = getMaxHeight(collapseElement) + 'px'; | ||
}, 0); | ||
emulateTransitionEnd(collapseElement, function() { | ||
removeClass(collapseElement,collapsing); | ||
addClass(collapseElement,component); | ||
addClass(collapseElement,inClass); | ||
collapseElement.style[height] = ''; | ||
collapseElement[style][height] = ''; | ||
isAnimating = false; | ||
collapseElement[setAttribute](ariaExpanded,'true'); | ||
bootstrapCustomEvent.call(collapseElement, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
}, | ||
@@ -52,17 +48,16 @@ closeAction = function(collapseElement) { | ||
isAnimating = true; | ||
removeClass(collapseElement,component); | ||
collapseElement.style[height] = getMaxHeight(collapseElement) + 'px'; | ||
collapseElement[style][height] = getMaxHeight(collapseElement) + 'px'; | ||
setTimeout(function() { | ||
addClass(collapseElement,collapsing); | ||
collapseElement.style[height] = '0px'; | ||
}, 10); | ||
setTimeout(function() { | ||
collapseElement[style][height] = '0px'; | ||
}, 0); | ||
emulateTransitionEnd(collapseElement, function() { | ||
removeClass(collapseElement,collapsing); | ||
removeClass(collapseElement,inClass); | ||
addClass(collapseElement,component); | ||
collapseElement.style[height] = ''; | ||
collapseElement[style][height] = ''; | ||
isAnimating = false; | ||
collapseElement[setAttribute](ariaExpanded,'false'); | ||
bootstrapCustomEvent.call(collapseElement, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
}, | ||
@@ -69,0 +64,0 @@ getTarget = function() { |
@@ -29,4 +29,3 @@ | ||
var eventTarget = e[target], hasData; | ||
if (!eventTarget || !eventTarget[parentNode]) return; // invalidate | ||
hasData = eventTarget[getAttribute](dataToggle) || eventTarget[parentNode][getAttribute](dataToggle); | ||
hasData = ( eventTarget.nodeType !== 1 && (eventTarget[getAttribute](dataToggle) || eventTarget[parentNode][getAttribute](dataToggle)) ); | ||
if ( eventTarget === element || eventTarget === parent || eventTarget[parentNode] === element ) { | ||
@@ -41,3 +40,3 @@ e.preventDefault(); // comment this line to stop preventing navigation when click target is a link | ||
} | ||
(/\#$/.test(eventTarget.href) || /\#$/.test(eventTarget[parentNode].href)) && e.preventDefault(); // should be here to prevent jumps | ||
(/\#$/.test(eventTarget.href) || eventTarget[parentNode] && /\#$/.test(eventTarget[parentNode].href)) && e.preventDefault(); // should be here to prevent jumps | ||
}, | ||
@@ -44,0 +43,0 @@ // private methods |
@@ -34,3 +34,2 @@ | ||
this[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : this[backdrop]; | ||
this[duration] = (isIE && isIE < 10) ? 50 : (options[duration] || parseInt(modal[getAttribute](dataDuration)) || 300); // the default modal fade duration option | ||
this[content] = options[content]; // JavaScript only | ||
@@ -49,6 +48,6 @@ | ||
var bodyStyle = body.currentStyle || globalObject.getComputedStyle(body), bodyPad = parseInt((bodyStyle[paddingRight]), 10); | ||
if (bodyIsOverflowing) { body.style[paddingRight] = (bodyPad + scrollbarWidth) + 'px'; } | ||
if (bodyIsOverflowing) { body[style][paddingRight] = (bodyPad + scrollbarWidth) + 'px'; } | ||
}, | ||
resetScrollbar = function () { | ||
body.style[paddingRight] = ''; | ||
body[style][paddingRight] = ''; | ||
}, | ||
@@ -69,8 +68,8 @@ measureScrollbar = function () { // thx walsh | ||
adjustDialog = function () { | ||
modal.style[paddingLeft] = !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal.style[paddingRight] = bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal[style][paddingLeft] = !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal[style][paddingRight] = bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
}, | ||
resetAdjustments = function () { | ||
modal.style[paddingLeft] = ''; | ||
modal.style[paddingRight] = ''; | ||
modal[style][paddingLeft] = ''; | ||
modal[style][paddingRight] = ''; | ||
}, | ||
@@ -148,4 +147,5 @@ createOverlay = function() { | ||
// we elegantly hide any opened modal | ||
var currentOpen = getElementsByClassName(document,component+' in')[0]; | ||
currentOpen && currentOpen !== modal && currentOpen.modalTrigger[stringModal].hide(); // we elegantly hide any opened modal | ||
currentOpen && currentOpen !== modal && currentOpen.modalTrigger[stringModal].hide(); | ||
@@ -161,3 +161,3 @@ if ( this[backdrop] ) { | ||
setTimeout( function() { | ||
modal.style.display = 'block'; | ||
modal[style].display = 'block'; | ||
@@ -175,8 +175,9 @@ checkScrollbar(); | ||
modal[setAttribute](ariaHidden, false); | ||
}, this[duration]/2); | ||
setTimeout( function() { | ||
}, 0); | ||
emulateTransitionEnd(modal, function() { | ||
open = self.open = true; | ||
setFocus(modal); | ||
bootstrapCustomEvent.call(modal, shownEvent, component, relatedTarget); | ||
}, this[duration]); | ||
}); | ||
}; | ||
@@ -193,5 +194,4 @@ this.hide = function() { | ||
setTimeout( function() { | ||
emulateTransitionEnd(modal, function() { | ||
removeClass(body,component+'-open'); | ||
resizeHandlerToggle(); | ||
@@ -203,6 +203,4 @@ dismissHandlerToggle(); | ||
resetScrollbar(); | ||
modal.style.display = ''; | ||
}, this[duration]/2); | ||
modal[style].display = ''; | ||
setTimeout( function() { | ||
if (!getElementsByClassName(document,component+' '+inClass)[0]) { removeOverlay(); } | ||
@@ -212,3 +210,3 @@ open = self.open = false; | ||
bootstrapCustomEvent.call(modal, hiddenEvent, component); | ||
}, this[duration]); | ||
}); | ||
}; | ||
@@ -215,0 +213,0 @@ this.setContent = function( content ) { |
@@ -15,3 +15,2 @@ | ||
animationData = element[getAttribute](dataAnimation), // true / false | ||
durationData = element[getAttribute](dataDuration), | ||
placementData = element[getAttribute](dataPlacement), | ||
@@ -42,5 +41,4 @@ dismissibleData = element[getAttribute](dataDismissible), | ||
this[placement] = options[placement] ? options[placement] : placementData || top; | ||
this[delay] = parseInt(options[delay] || delayData) || 100; | ||
this[delay] = parseInt(options[delay] || delayData) || 200; | ||
this[dismissible] = options[dismissible] || dismissibleData === 'true' ? true : false; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; | ||
this[container] = queryElement(options[container]) || queryElement(containerData) || body; | ||
@@ -103,3 +101,3 @@ | ||
self[container].appendChild(popover); | ||
popover.style.display = 'block'; | ||
popover[style].display = 'block'; | ||
popover[setAttribute](classString, component+ ' ' + placementSetting + ' ' + self[animation]); | ||
@@ -132,5 +130,5 @@ }, | ||
bootstrapCustomEvent.call(element, showEvent, component); | ||
setTimeout(function() { | ||
emulateTransitionEnd(popover, function() { | ||
bootstrapCustomEvent.call(element, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -145,6 +143,6 @@ }, 20 ); | ||
removeClass(popover,inClass); | ||
setTimeout(function() { | ||
emulateTransitionEnd(popover, function() { | ||
removePopover(); | ||
bootstrapCustomEvent.call(element, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -151,0 +149,0 @@ }, self[delay] ); |
@@ -13,4 +13,3 @@ | ||
// DATA API | ||
var durationData = element[getAttribute](dataDuration), | ||
heightData = element[getAttribute](dataHeight), | ||
var heightData = element[getAttribute](dataHeight), | ||
@@ -25,4 +24,3 @@ // strings | ||
options = options || {}; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; // default tab transition duration | ||
this[height] = (isIE && isIE < 10) ? false : (options[height] || heightData === 'true') || false; // filter legacy browsers | ||
this[height] = supportTransitions ? (options[height] || heightData === 'true') : false; // filter legacy browsers | ||
@@ -73,3 +71,3 @@ // bind, event targets | ||
if (tabsContentContainer) tabsContentContainer.style[height] = getMaxHeight(activeContent) + 'px'; // height animation | ||
if (tabsContentContainer) tabsContentContainer[style][height] = getMaxHeight(activeContent) + 'px'; // height animation | ||
@@ -80,5 +78,5 @@ bootstrapCustomEvent.call(activeTab, hideEvent, component, next); | ||
removeClass(activeContent,inClass); | ||
}, 10); | ||
}, 0); | ||
setTimeout(function() { | ||
emulateTransitionEnd(activeContent, function() { | ||
if (tabsContentContainer) addClass(tabsContentContainer,collapsing); | ||
@@ -89,3 +87,4 @@ removeClass(activeContent,active); | ||
addClass(nextContent,inClass); | ||
}, 10); | ||
if(tabsContentContainer) tabsContentContainer[style][height] = getMaxHeight(nextContent) + 'px'; // height animation | ||
}, 0); | ||
@@ -95,14 +94,16 @@ bootstrapCustomEvent.call(next, showEvent, component, activeTab); | ||
if(tabsContentContainer) tabsContentContainer.style[height] = getMaxHeight(nextContent) + 'px'; // height animation | ||
}, self[duration]*.7); | ||
}); | ||
setTimeout(function() { | ||
emulateTransitionEnd(nextContent, function() { | ||
bootstrapCustomEvent.call(next, shownEvent, component, activeTab); | ||
if (tabsContentContainer) { // height animation | ||
removeClass(tabsContentContainer,collapsing); | ||
tabsContentContainer.style[height] = ''; | ||
} | ||
activeTab[isAnimating] = next[isAnimating] = false; | ||
}, self[duration]*1.5); | ||
setTimeout(function(){ | ||
emulateTransitionEnd(tabsContentContainer, function(){ | ||
tabsContentContainer[style][height] = ''; | ||
removeClass(tabsContentContainer,collapsing); | ||
activeTab[isAnimating] = next[isAnimating] = false; | ||
}) | ||
},0); | ||
} else { activeTab[isAnimating] = next[isAnimating] = false; } | ||
}); | ||
} | ||
@@ -109,0 +110,0 @@ }; |
@@ -15,3 +15,2 @@ | ||
placementData = element[getAttribute](dataPlacement); | ||
durationData = element[getAttribute](dataDuration); | ||
delayData = element[getAttribute](dataDelay), | ||
@@ -31,4 +30,3 @@ containerData = element[getAttribute](dataContainer), | ||
this[placement] = options[placement] ? options[placement] : placementData || top; | ||
this[delay] = parseInt(options[delay] || delayData) || 100; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; | ||
this[delay] = parseInt(options[delay] || delayData) || 200; | ||
this[container] = queryElement(options[container]) || queryElement(containerData) || body; | ||
@@ -83,5 +81,5 @@ | ||
bootstrapCustomEvent.call(element, showEvent, component); | ||
setTimeout(function() { | ||
emulateTransitionEnd(tooltip, function() { | ||
bootstrapCustomEvent.call(element, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -96,6 +94,6 @@ }, 20 ); | ||
removeClass(tooltip,inClass); | ||
setTimeout(function() { | ||
emulateTransitionEnd(tooltip, function() { | ||
removeToolTip(); | ||
bootstrapCustomEvent.call(element, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -102,0 +100,0 @@ }, self[delay]); |
@@ -8,5 +8,5 @@ | ||
doc = document.documentElement, body = document.body, | ||
// IE browser detect | ||
isIE = (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) ? parseFloat( RegExp.$1 ) : false, | ||
isIE = (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) ? parseFloat( RegExp.$1 ) : false, | ||
@@ -35,3 +35,2 @@ // function toggle attributes | ||
dataKeyboard = 'data-keyboard', | ||
dataDuration = 'data-duration', | ||
dataTarget = 'data-target', | ||
@@ -97,5 +96,9 @@ dataInterval = 'data-interval', | ||
indexOf = 'indexOf', | ||
parentNode = 'parentNode', | ||
length = 'length', | ||
indexOf = 'indexOf', | ||
parentNode = 'parentNode', | ||
length = 'length', | ||
toLowerCase = 'toLowerCase', | ||
Transition = 'Transition', | ||
Webkit = 'Webkit', | ||
style = 'style', | ||
@@ -116,2 +119,7 @@ active = 'active', | ||
// transitionEnd since 2.0.4 | ||
supportTransitions = Webkit+Transition in doc[style] || Transition[toLowerCase]() in doc[style], | ||
transitionEndEvent = Webkit+Transition in doc[style] ? Webkit[toLowerCase]()+Transition+'End' : Transition[toLowerCase]()+'end', | ||
// set new focus element since 2.0.3 | ||
@@ -167,2 +175,12 @@ setFocus = function(element){ | ||
}, | ||
one = function (element, event, handler) { // one since 2.0.4 | ||
on(element, event, function handlerWrapper(){ | ||
handler(); | ||
off(element, event, handlerWrapper); | ||
}); | ||
}, | ||
emulateTransitionEnd = function(element,handler){ // emulateTransitionEnd since 2.0.4 | ||
if (supportTransitions) { one(element,transitionEndEvent, handler); } | ||
else { handler(); } | ||
}, | ||
bootstrapCustomEvent = function (eventName, componentName, related) { | ||
@@ -181,3 +199,3 @@ var OriginalCustomEvent = new CustomEvent( eventName + '.bs.' + componentName); | ||
for (var i=0; i < lookUp[length]; i++) { | ||
var attrValue = lookUp[i][getAttribute](dataAttribute), expectedAttrValue = component.replace(/spy/i,'').toLowerCase(); | ||
var attrValue = lookUp[i][getAttribute](dataAttribute), expectedAttrValue = component.replace(/spy/i,'')[toLowerCase](); | ||
if ( attrValue && component === stringButton && ( attrValue[indexOf](expectedAttrValue) > -1 ) // data-toggle="buttons" | ||
@@ -192,8 +210,7 @@ || attrValue === expectedAttrValue ) { // all other components | ||
getOuterHeight = function (child) { | ||
// the getComputedStyle polyfill would do this for us, but we want to make sure it does | ||
var style = child && (child.currentStyle || globalObject.getComputedStyle(child)), | ||
btp = /px/.test(style.borderTopWidth) ? Math.round(style.borderTopWidth.replace('px','')) : 0, | ||
btb = /px/.test(style.borderBottomWidth) ? Math.round(style.borderBottomWidth.replace('px','')) : 0, | ||
mtp = /px/.test(style.marginTop) ? Math.round(style.marginTop.replace('px','')) : 0, | ||
mbp = /px/.test(style.marginBottom) ? Math.round(style.marginBottom.replace('px','')) : 0; | ||
var childStyle = child && (child.currentStyle || globalObject.getComputedStyle(child)), | ||
btp = /px/.test(childStyle.borderTopWidth) ? Math.round(childStyle.borderTopWidth.replace('px','')) : 0, | ||
btb = /px/.test(childStyle.borderBottomWidth) ? Math.round(childStyle.borderBottomWidth.replace('px','')) : 0, | ||
mtp = /px/.test(childStyle.marginTop) ? Math.round(childStyle.marginTop.replace('px','')) : 0, | ||
mbp = /px/.test(childStyle.marginBottom) ? Math.round(childStyle.marginBottom.replace('px','')) : 0; | ||
return child[clientHeight] + parseInt( btp ) + parseInt( btb ) + parseInt( mtp ) + parseInt( mbp ); | ||
@@ -230,16 +247,16 @@ }, | ||
if ( position === top ) { // TOP | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
} else if ( position === bottom ) { // BOTTOM | ||
element.style[top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
element[style][top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
} else if ( position === left ) { // LEFT | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w + 'px'; | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w + 'px'; | ||
} else if ( position === right ) { // RIGHT | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element.style[left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
} | ||
@@ -250,6 +267,6 @@ element.className[indexOf](position) === -1 && (element.className = element.className.replace(tipPositions,position)); | ||
return position === top ? bottom : // top | ||
position === bottom ? top : // bottom | ||
position === left ? right : // left | ||
position === right ? left : position; // right | ||
position === bottom ? top : // bottom | ||
position === left ? right : // left | ||
position === right ? left : position; // right | ||
}; | ||
@@ -14,4 +14,4 @@ | ||
var self = this, component = 'alert', | ||
alert = getClosest(element,'.'+component), duration = (isIE && isIE < 10) ? 0 : 300, // default alert transition duration | ||
// handler | ||
alert = getClosest(element,'.'+component), | ||
// handlers | ||
clickHandler = function(e){ | ||
@@ -25,2 +25,7 @@ var eventTarget = e[target]; | ||
} | ||
}, | ||
transitionEndHandler = function(){ | ||
bootstrapCustomEvent.call(alert, closedEvent, component); | ||
off(element, clickEvent, clickHandler); // detach it's listener | ||
alert[parentNode].removeChild(alert); | ||
}; | ||
@@ -33,9 +38,5 @@ | ||
removeClass(alert,showClass); | ||
setTimeout(function() { | ||
if (alert) { | ||
bootstrapCustomEvent.call(alert, closedEvent, component); | ||
off(element, clickEvent, clickHandler); // detach it's listener | ||
alert[parentNode].removeChild(alert); | ||
} | ||
}, duration); | ||
if (alert) { | ||
emulateTransitionEnd(alert,transitionEndHandler); | ||
} | ||
} | ||
@@ -42,0 +43,0 @@ }; |
@@ -19,3 +19,2 @@ | ||
keyboardData = element[getAttribute](dataKeyboard) === 'true' || false, | ||
durationData = parseInt(element[getAttribute](dataDuration)) || 600, // bootstrap carousel default transition duration | ||
@@ -31,3 +30,2 @@ // strings | ||
this[pause] = (options[pause] === hoverEvent || pauseData) ? hoverEvent : false; // false / hover | ||
this[duration] = (isIE && isIE < 10) ? 0 : options[duration] || durationData; | ||
@@ -42,3 +40,3 @@ if ( !( options[interval] || intervalData ) ) { // determine slide interval | ||
var self = this, index = element.index = 0, timer = element.timer = 0, | ||
isSliding = false, // isSliding prevents click event handlers when animation is running | ||
isSliding = this.isSliding = false, // isSliding prevents click event handlers when animation is running | ||
slides = getElementsByClassName(element,carouselItem), total = slides[length], | ||
@@ -152,11 +150,11 @@ slideDirection = this[direction] = left, | ||
var activeItem = this.getActiveIndex(), // the current active | ||
orientation = slideDirection === left ? 'next' : 'prev'; //determine type | ||
orientation = slideDirection === left ? 'next' : 'prev'; //determine type | ||
bootstrapCustomEvent.call(element, slideEvent, component, slides[next]); // here we go with the slide | ||
isSliding = true; | ||
isSliding = this.isSliding = true; | ||
clearInterval(timer); | ||
setActivePage( next ); | ||
if ( hasClass(element,'slide') && !(isIE && isIE < 10) ) { | ||
if ( supportTransitions && hasClass(element,'slide') ) { | ||
addClass(slides[next],carouselItem +'-'+ orientation); | ||
@@ -167,4 +165,4 @@ slides[next][offsetWidth]; | ||
setTimeout(function() { //we're gonna fake waiting for the animation to finish, cleaner and better | ||
isSliding = false; | ||
one(slides[next], transitionEndEvent, function(){ | ||
isSliding = self.isSliding = false; | ||
@@ -182,4 +180,4 @@ addClass(slides[next],active); | ||
bootstrapCustomEvent.call(element, slidEvent, component, slides[next]); // here we go with the slid event | ||
}); | ||
}, this[duration] + 100 ); | ||
} else { | ||
@@ -195,3 +193,3 @@ addClass(slides[next],active); | ||
bootstrapCustomEvent.call(element, slidEvent, component, slides[next]); // here we go with the slid event | ||
}, this[duration] + 100 ); | ||
}, 100 ); | ||
} | ||
@@ -218,3 +216,2 @@ }; | ||
this[keyboard] === true && on( globalObject, keydownEvent, keyHandler, false); | ||
} | ||
@@ -221,0 +218,0 @@ if (this.getActiveIndex()<0) { |
@@ -14,5 +14,3 @@ | ||
options = options || {}; | ||
options.duration = parseInt(options.duration || element[getAttribute](dataDuration)); | ||
this[duration] = (isIE && isIE < 10) ? 0 : (options.duration || 300); // default collapse transition duration | ||
@@ -32,17 +30,15 @@ // event targets and constants | ||
isAnimating = true; | ||
removeClass(collapseElement,component); | ||
addClass(collapseElement,collapsing); | ||
collapseElement.style[height] = '0px'; | ||
addClass(collapseElement,showClass); | ||
setTimeout(function() { | ||
collapseElement.style[height] = getMaxHeight(collapseElement) + 'px'; | ||
}, 10); | ||
setTimeout(function() { | ||
collapseElement[style][height] = getMaxHeight(collapseElement) + 'px'; | ||
}, 0); | ||
emulateTransitionEnd(collapseElement, function(){ | ||
removeClass(collapseElement,collapsing); | ||
addClass(collapseElement,component); | ||
addClass(collapseElement,showClass); | ||
collapseElement.style[height] = ''; | ||
collapseElement[style][height] = ''; | ||
isAnimating = false; | ||
collapseElement[setAttribute](ariaExpanded,'true'); | ||
bootstrapCustomEvent.call(collapseElement, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
}, | ||
@@ -52,17 +48,16 @@ closeAction = function(collapseElement) { | ||
isAnimating = true; | ||
removeClass(collapseElement,component); | ||
collapseElement.style[height] = getMaxHeight(collapseElement) + 'px'; | ||
collapseElement[style][height] = getMaxHeight(collapseElement) + 'px'; | ||
setTimeout(function() { | ||
addClass(collapseElement,collapsing); | ||
collapseElement.style[height] = '0px'; | ||
}, 10); | ||
setTimeout(function() { | ||
collapseElement[style][height] = '0px'; | ||
}, 0); | ||
emulateTransitionEnd(collapseElement, function(){ | ||
removeClass(collapseElement,collapsing); | ||
removeClass(collapseElement,showClass); | ||
addClass(collapseElement,component); | ||
collapseElement.style[height] = ''; | ||
collapseElement[style][height] = ''; | ||
isAnimating = false; | ||
collapseElement[setAttribute](ariaExpanded,'false'); | ||
bootstrapCustomEvent.call(collapseElement, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
}, | ||
@@ -69,0 +64,0 @@ getTarget = function() { |
@@ -29,4 +29,3 @@ | ||
var eventTarget = e[target], hasData; | ||
if (!eventTarget || !eventTarget[parentNode]) return; // invalidate | ||
hasData = eventTarget[getAttribute](dataToggle) || eventTarget[parentNode][getAttribute](dataToggle); | ||
hasData = ( eventTarget.nodeType !== 1 && (eventTarget[getAttribute](dataToggle) || eventTarget[parentNode][getAttribute](dataToggle)) ); | ||
if ( eventTarget === element || eventTarget === parent || eventTarget[parentNode] === element ) { | ||
@@ -41,3 +40,3 @@ e.preventDefault(); // comment this line to stop preventing navigation when click target is a link | ||
} | ||
(/\#$/.test(eventTarget.href) || /\#$/.test(eventTarget[parentNode].href)) && e.preventDefault(); // should be here to prevent jumps | ||
(/\#$/.test(eventTarget.href) || eventTarget[parentNode] && /\#$/.test(eventTarget[parentNode].href)) && e.preventDefault(); // should be here to prevent jumps | ||
}, | ||
@@ -44,0 +43,0 @@ // private methods |
@@ -34,3 +34,2 @@ | ||
this[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : this[backdrop]; | ||
this[duration] = (isIE && isIE < 10) ? 50 : (options[duration] || parseInt(modal[getAttribute](dataDuration)) || 300); // the default modal fade duration option | ||
this[content] = options[content]; // JavaScript only | ||
@@ -49,6 +48,6 @@ | ||
var bodyStyle = body.currentStyle || globalObject.getComputedStyle(body), bodyPad = parseInt((bodyStyle[paddingRight]), 10); | ||
if (bodyIsOverflowing) { body.style[paddingRight] = (bodyPad + scrollbarWidth) + 'px'; } | ||
if (bodyIsOverflowing) { body[style][paddingRight] = (bodyPad + scrollbarWidth) + 'px'; } | ||
}, | ||
resetScrollbar = function () { | ||
body.style[paddingRight] = ''; | ||
body[style][paddingRight] = ''; | ||
}, | ||
@@ -69,8 +68,8 @@ measureScrollbar = function () { // thx walsh | ||
adjustDialog = function () { | ||
modal.style[paddingLeft] = !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal.style[paddingRight] = bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal[style][paddingLeft] = !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
modal[style][paddingRight] = bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth + 'px' : ''; | ||
}, | ||
resetAdjustments = function () { | ||
modal.style[paddingLeft] = ''; | ||
modal.style[paddingRight] = ''; | ||
modal[style][paddingLeft] = ''; | ||
modal[style][paddingRight] = ''; | ||
}, | ||
@@ -148,4 +147,5 @@ createOverlay = function() { | ||
var currentOpen = getElementsByClassName(document,component+' in')[0]; | ||
currentOpen && currentOpen !== modal && currentOpen.modalTrigger[stringModal].hide(); // we elegantly hide any opened modal | ||
// we elegantly hide any opened modal | ||
var currentOpen = getElementsByClassName(document,component+' '+showClass)[0]; | ||
currentOpen && currentOpen !== modal && currentOpen.modalTrigger[stringModal].hide(); | ||
@@ -161,3 +161,3 @@ if ( this[backdrop] ) { | ||
setTimeout( function() { | ||
modal.style.display = 'block'; | ||
modal[style].display = 'block'; | ||
@@ -175,8 +175,9 @@ checkScrollbar(); | ||
modal[setAttribute](ariaHidden, false); | ||
}, this[duration]/2); | ||
setTimeout( function() { | ||
}, 0); | ||
emulateTransitionEnd(modal,function(){ | ||
open = self.open = true; | ||
setFocus(modal); | ||
bootstrapCustomEvent.call(modal, shownEvent, component, relatedTarget); | ||
}, this[duration]); | ||
}); | ||
}; | ||
@@ -193,5 +194,4 @@ this.hide = function() { | ||
setTimeout( function() { | ||
emulateTransitionEnd(modal, function(){ | ||
removeClass(body,component+'-open'); | ||
resizeHandlerToggle(); | ||
@@ -203,6 +203,4 @@ dismissHandlerToggle(); | ||
resetScrollbar(); | ||
modal.style.display = ''; | ||
}, this[duration]/2); | ||
modal[style].display = ''; | ||
setTimeout( function() { | ||
if (!getElementsByClassName(document,component+' '+showClass)[0]) { removeOverlay(); } | ||
@@ -212,3 +210,3 @@ open = self.open = false; | ||
bootstrapCustomEvent.call(modal, hiddenEvent, component); | ||
}, this[duration]); | ||
}); | ||
}; | ||
@@ -215,0 +213,0 @@ this.setContent = function( content ) { |
@@ -15,3 +15,2 @@ | ||
animationData = element[getAttribute](dataAnimation), // true / false | ||
durationData = element[getAttribute](dataDuration), | ||
placementData = element[getAttribute](dataPlacement), | ||
@@ -42,5 +41,4 @@ dismissibleData = element[getAttribute](dataDismissible), | ||
this[placement] = options[placement] ? options[placement] : placementData || top; | ||
this[delay] = parseInt(options[delay] || delayData) || 100; | ||
this[delay] = parseInt(options[delay] || delayData) || 200; | ||
this[dismissible] = options[dismissible] || dismissibleData === 'true' ? true : false; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; | ||
this[container] = queryElement(options[container]) || queryElement(containerData) || body; | ||
@@ -102,3 +100,3 @@ | ||
self[container].appendChild(popover); | ||
popover.style.display = 'block'; | ||
popover[style].display = 'block'; | ||
popover[setAttribute](classString, component+ ' ' + component+'-'+placementSetting + ' ' + self[animation]); | ||
@@ -131,5 +129,5 @@ }, | ||
bootstrapCustomEvent.call(element, showEvent, component); | ||
setTimeout(function() { | ||
emulateTransitionEnd(popover, function(){ | ||
bootstrapCustomEvent.call(element, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -144,6 +142,6 @@ }, 20 ); | ||
removeClass(popover,showClass); | ||
setTimeout(function() { | ||
emulateTransitionEnd(popover, function() { | ||
removePopover(); | ||
bootstrapCustomEvent.call(element, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -166,3 +164,3 @@ }, self[delay] ); | ||
// dismiss on window resize | ||
if ( !(isIE && isIE < 9) ) { on( globalObject, resizeEvent, self.hide ); } | ||
on( globalObject, resizeEvent, self.hide ); | ||
@@ -169,0 +167,0 @@ } |
@@ -88,5 +88,3 @@ | ||
on( scrollTarget, scrollEvent, this.refresh ); | ||
if ( !(isIE && isIE < 9)) { | ||
on( globalObject, resizeEvent, this.refresh ); | ||
} | ||
on( globalObject, resizeEvent, this.refresh ); | ||
} | ||
@@ -93,0 +91,0 @@ this.refresh(); |
@@ -13,4 +13,3 @@ | ||
// DATA API | ||
var durationData = element[getAttribute](dataDuration), | ||
heightData = element[getAttribute](dataHeight), | ||
var heightData = element[getAttribute](dataHeight), | ||
@@ -25,4 +24,3 @@ // strings | ||
options = options || {}; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; // default tab transition duration | ||
this[height] = (isIE && isIE < 10) ? false : (options[height] || heightData === 'true') || false; // filter legacy browsers | ||
this[height] = options[height] || heightData === 'true' || false; | ||
@@ -76,3 +74,3 @@ // bind, event targets | ||
if (tabsContentContainer) tabsContentContainer.style[height] = getMaxHeight(activeContent) + 'px'; // height animation | ||
if (tabsContentContainer) tabsContentContainer[style][height] = getMaxHeight(activeContent) + 'px'; // height animation | ||
@@ -83,5 +81,5 @@ bootstrapCustomEvent.call(activeTab, hideEvent, component, next); | ||
removeClass(activeContent,showClass); | ||
}, 10); | ||
}, 0); | ||
setTimeout(function() { | ||
emulateTransitionEnd(activeContent, function() { | ||
if (tabsContentContainer) addClass(tabsContentContainer,collapsing); | ||
@@ -92,3 +90,4 @@ removeClass(activeContent,active); | ||
addClass(nextContent,showClass); | ||
}, 10); | ||
if (tabsContentContainer) tabsContentContainer[style][height] = getMaxHeight(nextContent) + 'px'; // height animation | ||
}, 0); | ||
@@ -98,14 +97,16 @@ bootstrapCustomEvent.call(next, showEvent, component, activeTab); | ||
if(tabsContentContainer) tabsContentContainer.style[height] = getMaxHeight(nextContent) + 'px'; // height animation | ||
}, self[duration]*.7); | ||
}); | ||
setTimeout(function() { | ||
emulateTransitionEnd(nextContent, function() { | ||
bootstrapCustomEvent.call(next, shownEvent, component, activeTab); | ||
if (tabsContentContainer) { // height animation | ||
removeClass(tabsContentContainer,collapsing); | ||
tabsContentContainer.style[height] = ''; | ||
} | ||
activeTab[isAnimating] = next[isAnimating] = false; | ||
}, self[duration]*1.5); | ||
setTimeout(function(){ | ||
emulateTransitionEnd(tabsContentContainer, function(){ | ||
tabsContentContainer[style][height] = ''; | ||
removeClass(tabsContentContainer,collapsing); | ||
activeTab[isAnimating] = next[isAnimating] = false; | ||
}) | ||
},0); | ||
} else { activeTab[isAnimating] = next[isAnimating] = false; } | ||
}); | ||
} | ||
@@ -112,0 +113,0 @@ }; |
@@ -15,3 +15,2 @@ | ||
placementData = element[getAttribute](dataPlacement); | ||
durationData = element[getAttribute](dataDuration); | ||
delayData = element[getAttribute](dataDelay), | ||
@@ -31,4 +30,3 @@ containerData = element[getAttribute](dataContainer), | ||
this[placement] = options[placement] ? options[placement] : placementData || top; | ||
this[delay] = parseInt(options[delay] || delayData) || 100; | ||
this[duration] = (isIE && isIE < 10) ? 0 : parseInt(options[duration] || durationData) || 150; | ||
this[delay] = parseInt(options[delay] || delayData) || 200; | ||
this[container] = queryElement(options[container]) || queryElement(containerData) || body; | ||
@@ -81,5 +79,5 @@ | ||
bootstrapCustomEvent.call(element, showEvent, component); | ||
setTimeout(function() { | ||
emulateTransitionEnd(tooltip, function() { | ||
bootstrapCustomEvent.call(element, shownEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -94,6 +92,6 @@ }, 20 ); | ||
removeClass(tooltip,showClass); | ||
setTimeout(function() { | ||
emulateTransitionEnd(tooltip, function() { | ||
removeToolTip(); | ||
bootstrapCustomEvent.call(element, hiddenEvent, component); | ||
}, self[duration]); | ||
}); | ||
} | ||
@@ -100,0 +98,0 @@ }, self[delay]); |
@@ -8,5 +8,2 @@ | ||
doc = document.documentElement, body = document.body, | ||
// IE browser detect | ||
isIE = (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) ? parseFloat( RegExp.$1 ) : false, | ||
@@ -34,3 +31,2 @@ // function toggle attributes | ||
dataKeyboard = 'data-keyboard', | ||
dataDuration = 'data-duration', | ||
dataTarget = 'data-target', | ||
@@ -53,3 +49,3 @@ dataInterval = 'data-interval', | ||
backdrop = 'backdrop', keyboard = 'keyboard', delay = 'delay', | ||
duration = 'duration', content = 'content', target = 'target', | ||
content = 'content', target = 'target', | ||
interval = 'interval', pause = 'pause', animation = 'animation', | ||
@@ -89,12 +85,16 @@ placement = 'placement', container = 'container', | ||
// other | ||
getAttribute = 'getAttribute', | ||
setAttribute = 'setAttribute', | ||
hasAttribute = 'hasAttribute', | ||
getElementsByTagName = 'getElementsByTagName', | ||
getBoundingClientRect= 'getBoundingClientRect', | ||
getElementsByCLASSNAME = 'getElementsByClassName', | ||
getAttribute = 'getAttribute', | ||
setAttribute = 'setAttribute', | ||
hasAttribute = 'hasAttribute', | ||
getElementsByTagName = 'getElementsByTagName', | ||
getBoundingClientRect = 'getBoundingClientRect', | ||
getElementsByCLASSNAME = 'getElementsByClassName', | ||
indexOf = 'indexOf', | ||
parentNode = 'parentNode', | ||
length = 'length', | ||
indexOf = 'indexOf', | ||
parentNode = 'parentNode', | ||
length = 'length', | ||
toLowerCase = 'toLowerCase', | ||
Transition = 'Transition', | ||
Webkit = 'Webkit', | ||
style = 'style', | ||
@@ -115,2 +115,6 @@ active = 'active', | ||
// transitionEnd since 2.0.4 | ||
supportTransitions = Webkit+Transition in doc[style] || Transition[toLowerCase]() in doc[style], | ||
transitionEndEvent = Webkit+Transition in doc[style] ? Webkit[toLowerCase]()+Transition+'End' : Transition[toLowerCase]()+'end', | ||
// set new focus element since 2.0.3 | ||
@@ -161,2 +165,12 @@ setFocus = function(element){ | ||
}, | ||
one = function (element, event, handler) { // one since 2.0.4 | ||
on(element, event, function handlerWrapper(){ | ||
handler(); | ||
off(element, event, handlerWrapper); | ||
}); | ||
}, | ||
emulateTransitionEnd = function(element,handler){ // emulateTransitionEnd since 2.0.4 | ||
if (supportTransitions) { one(element,transitionEndEvent, handler); } | ||
else { handler(); } | ||
}, | ||
bootstrapCustomEvent = function (eventName, componentName, related) { | ||
@@ -185,8 +199,7 @@ var OriginalCustomEvent = new CustomEvent( eventName + '.bs.' + componentName); | ||
getOuterHeight = function (child) { | ||
// the getComputedStyle polyfill would do this for us, but we want to make sure it does | ||
var style = child && (child.currentStyle || globalObject.getComputedStyle(child)), | ||
btp = /px/.test(style.borderTopWidth) ? Math.round(style.borderTopWidth.replace('px','')) : 0, | ||
btb = /px/.test(style.borderBottomWidth) ? Math.round(style.borderBottomWidth.replace('px','')) : 0, | ||
mtp = /px/.test(style.marginTop) ? Math.round(style.marginTop.replace('px','')) : 0, | ||
mbp = /px/.test(style.marginBottom) ? Math.round(style.marginBottom.replace('px','')) : 0; | ||
var childStyle = child && globalObject.getComputedStyle(child), | ||
btp = /px/.test(childStyle.borderTopWidth) ? Math.round(childStyle.borderTopWidth.replace('px','')) : 0, | ||
btb = /px/.test(childStyle.borderBottomWidth) ? Math.round(childStyle.borderBottomWidth.replace('px','')) : 0, | ||
mtp = /px/.test(childStyle.marginTop) ? Math.round(childStyle.marginTop.replace('px','')) : 0, | ||
mbp = /px/.test(childStyle.marginBottom) ? Math.round(childStyle.marginBottom.replace('px','')) : 0; | ||
return child[clientHeight] + parseInt( btp ) + parseInt( btb ) + parseInt( mtp ) + parseInt( mbp ); | ||
@@ -223,16 +236,16 @@ }, | ||
if ( position === top ) { // TOP | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px' | ||
} else if ( position === bottom ) { // BOTTOM | ||
element.style[top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
element[style][top] = rect[top] + scroll.y + linkDimensions.h + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + 'px'; | ||
} else if ( position === left ) { // LEFT | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element.style[left] = rect[left] + scroll.x - elementDimensions.w + 'px'; | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x - elementDimensions.w + 'px'; | ||
} else if ( position === right ) { // RIGHT | ||
element.style[top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element.style[left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
element[style][top] = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2 + 'px'; | ||
element[style][left] = rect[left] + scroll.x + linkDimensions.w + 'px'; | ||
} | ||
@@ -239,0 +252,0 @@ element.className[indexOf](position) === -1 && (element.className = element.className.replace(tipPositions,position)); |
{ | ||
"name": "bootstrap.native", | ||
"version": "2.0.3", | ||
"description": "Native Javascript for Bootstrap 3, the sweetest Javascript library without jQuery.", | ||
"version": "2.0.4", | ||
"description": "Native Javascript for Bootstrap, the sweetest Javascript library without jQuery.", | ||
"main": "dist/bootstrap-native.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
# Native Javascript for Bootstrap | ||
This is a library developed with native Javascript for <strong>Bootstrap 3</strong> series, and featuring superior performance compared to the original jQuery Plugins. Thanks to [Ingwie Phoenix](https://github.com/IngwiePhoenix) for contributing with npm/RequireJS/CommonJS compatibility. A huge advantage is the size, this library is only ***20Kb*** minified and ***6.5Kb*** gZipped. | ||
This is a library developed with native Javascript for both <strong>Bootstrap 3</strong> and <strong>Bootstrap 4</strong> series, featuring superior performance compared to the original jQuery Plugins. Thanks to [Ingwie Phoenix](https://github.com/IngwiePhoenix) for contributing with npm/RequireJS/CommonJS compatibility. A huge advantage is the size, this library is only ***20Kb*** minified and ***6.5Kb*** gZipped. | ||
@@ -22,10 +22,10 @@ See <a href="http://thednp.github.io/bootstrap.native/">demo</a> for scripting examples and instructions. | ||
Traditional script-tag example: | ||
**Traditional script-tag example:** | ||
```html | ||
<!-- Using one of the CDN repositories--> | ||
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.native/1.0.5/bootstrap-native.min.js"></script> | ||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap.native/1.0.5/bootstrap-native.min.js"></script> | ||
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.native/2.0.4/bootstrap-native.min.js"></script> | ||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap.native/2.0.4/bootstrap-native.min.js"></script> | ||
<!-- Using a local assets folder --> | ||
<script type="text/javascript" src="/assets/js/bootstrap.native.min.js"></script> | ||
<script type="text/javascript" src="/assets/js/bootstrap-native.min.js"></script> | ||
<!-- Using Bower --> | ||
@@ -35,2 +35,14 @@ <script type="text/javascript" src="/bower_components/bootstrap.native/dist/bootstrap-native.min.js"></script> | ||
**Use the Bootstrap 4 version:** | ||
```html | ||
<!-- Using one of the CDN repositories--> | ||
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.native/2.0.4/bootstrap-native-v4.min.js"></script> | ||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap.native/2.0.4/bootstrap-native-v4.min.js"></script> | ||
<!-- Using a local assets folder --> | ||
<script type="text/javascript" src="/assets/js/bootstrap-native-v4.min.js"></script> | ||
<!-- Using Bower --> | ||
<script type="text/javascript" src="/bower_components/bootstrap.native/dist/bootstrap-native-v4.min.js"></script> | ||
``` | ||
**Warning:** Do not use files directly from `/lib` folder! These files are just sources for the builds located in the `/dist` folder. | ||
@@ -46,3 +58,3 @@ | ||
**Note:** If you are working in a virtual browser environment (i.e. running front-end tests in NodeJS), bootstrap-native requires both `window` and `document` to be in scope. You will need to use a mock browser. | ||
**Note:** If you are working in a virtual browser environment (i.e. running front-end tests in NodeJS), `bootstrap.native` requires both `window` and `document` to be in scope. You will need to use a mock browser. | ||
@@ -56,4 +68,14 @@ | ||
# Browser Support | ||
The components are developed with clean code mainly for modern browsers that nativelly support HTML5. When using polyfills, IE8-IE9 will thank you. | ||
The components are developed with clean code mainly for modern browsers that nativelly support HTML5. When using polyfills, IE8-IE10 will thank you. The library comes with a custom polyfill you can use right away. | ||
```html | ||
<!-- Using one of the CDN repositories--> | ||
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.native/2.0.4/polyfill.min.js"></script> | ||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap.native/2.0.4/polyfill.min.js"></script> | ||
<!-- Using a local assets folder --> | ||
<script type="text/javascript" src="/assets/js/polyfill.min.js"></script> | ||
<!-- Using Bower --> | ||
<script type="text/javascript" src="/bower_components/bootstrap.native/dist/polyfill.min.js"></script> | ||
``` | ||
# Custom Builds | ||
@@ -60,0 +82,0 @@ You can make a custom build of bootstrap-native, including only the modules you need, by using the `build.js` and `build-v4.js` scripts. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
750039
7386
104