1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-04 13:10:09 +02:00

update dependencies

This commit is contained in:
s2
2018-10-09 09:51:34 +02:00
parent 4fcc873901
commit da4083f574
1112 changed files with 23205 additions and 21697 deletions

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): alert.js
* Bootstrap (v4.1.3): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@ const Alert = (($) => {
*/
const NAME = 'alert'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.alert'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -84,7 +84,7 @@ const Alert = (($) => {
let parent = false
if (selector) {
parent = $(selector)[0]
parent = document.querySelector(selector)
}
if (!parent) {

View File

@@ -2,7 +2,7 @@ import $ from 'jquery'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): button.js
* Bootstrap (v4.1.3): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -15,7 +15,7 @@ const Button = (($) => {
*/
const NAME = 'button'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.button'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -68,15 +68,15 @@ const Button = (($) => {
)[0]
if (rootElement) {
const input = $(this._element).find(Selector.INPUT)[0]
const input = this._element.querySelector(Selector.INPUT)
if (input) {
if (input.type === 'radio') {
if (input.checked &&
$(this._element).hasClass(ClassName.ACTIVE)) {
this._element.classList.contains(ClassName.ACTIVE)) {
triggerChangeEvent = false
} else {
const activeElement = $(rootElement).find(Selector.ACTIVE)[0]
const activeElement = rootElement.querySelector(Selector.ACTIVE)
if (activeElement) {
$(activeElement).removeClass(ClassName.ACTIVE)
@@ -91,7 +91,7 @@ const Button = (($) => {
rootElement.classList.contains('disabled')) {
return
}
input.checked = !$(this._element).hasClass(ClassName.ACTIVE)
input.checked = !this._element.classList.contains(ClassName.ACTIVE)
$(input).trigger('change')
}
@@ -102,7 +102,7 @@ const Button = (($) => {
if (addAriaPressed) {
this._element.setAttribute('aria-pressed',
!$(this._element).hasClass(ClassName.ACTIVE))
!this._element.classList.contains(ClassName.ACTIVE))
}
if (triggerChangeEvent) {

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): carousel.js
* Bootstrap (v4.1.3): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@ const Carousel = (($) => {
*/
const NAME = 'carousel'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.carousel'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -99,7 +99,7 @@ const Carousel = (($) => {
this._config = this._getConfig(config)
this._element = $(element)[0]
this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]
this._indicatorsElement = this._element.querySelector(Selector.INDICATORS)
this._addEventListeners()
}
@@ -142,7 +142,7 @@ const Carousel = (($) => {
this._isPaused = true
}
if ($(this._element).find(Selector.NEXT_PREV)[0]) {
if (this._element.querySelector(Selector.NEXT_PREV)) {
Util.triggerTransitionEnd(this._element)
this.cycle(true)
}
@@ -170,7 +170,7 @@ const Carousel = (($) => {
}
to(index) {
this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]
this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)
const activeIndex = this._getItemIndex(this._activeElement)
@@ -269,7 +269,9 @@ const Carousel = (($) => {
}
_getItemIndex(element) {
this._items = $.makeArray($(element).parent().find(Selector.ITEM))
this._items = element && element.parentNode
? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM))
: []
return this._items.indexOf(element)
}
@@ -294,7 +296,7 @@ const Carousel = (($) => {
_triggerSlideEvent(relatedTarget, eventDirectionName) {
const targetIndex = this._getItemIndex(relatedTarget)
const fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0])
const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM))
const slideEvent = $.Event(Event.SLIDE, {
relatedTarget,
direction: eventDirectionName,
@@ -309,8 +311,8 @@ const Carousel = (($) => {
_setActiveIndicatorElement(element) {
if (this._indicatorsElement) {
$(this._indicatorsElement)
.find(Selector.ACTIVE)
const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE))
$(indicators)
.removeClass(ClassName.ACTIVE)
const nextIndicator = this._indicatorsElement.children[
@@ -324,7 +326,7 @@ const Carousel = (($) => {
}
_slide(direction, element) {
const activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]
const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)
const activeElementIndex = this._getItemIndex(activeElement)
const nextElement = element || activeElement &&
this._getItemByDirection(direction, activeElement)
@@ -492,10 +494,11 @@ const Carousel = (($) => {
.on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)
$(window).on(Event.LOAD_DATA_API, () => {
$(Selector.DATA_RIDE).each(function () {
const $carousel = $(this)
const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))
for (let i = 0, len = carousels.length; i < len; i++) {
const $carousel = $(carousels[i])
Carousel._jQueryInterface.call($carousel, $carousel.data())
})
}
})
/**

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): collapse.js
* Bootstrap (v4.1.3): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@ const Collapse = (($) => {
*/
const NAME = 'collapse'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.collapse'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -68,15 +68,18 @@ const Collapse = (($) => {
this._isTransitioning = false
this._element = element
this._config = this._getConfig(config)
this._triggerArray = $.makeArray($(
this._triggerArray = $.makeArray(document.querySelectorAll(
`[data-toggle="collapse"][href="#${element.id}"],` +
`[data-toggle="collapse"][data-target="#${element.id}"]`
))
const tabToggles = $(Selector.DATA_TOGGLE)
for (let i = 0; i < tabToggles.length; i++) {
const elem = tabToggles[i]
const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
for (let i = 0, len = toggleList.length; i < len; i++) {
const elem = toggleList[i]
const selector = Util.getSelectorFromElement(elem)
if (selector !== null && $(selector).filter(element).length > 0) {
const filterElement = [].slice.call(document.querySelectorAll(selector))
.filter((foundElem) => foundElem === element)
if (selector !== null && filterElement.length > 0) {
this._selector = selector
this._triggerArray.push(elem)
}
@@ -123,11 +126,9 @@ const Collapse = (($) => {
let activesData
if (this._parent) {
actives = $.makeArray(
$(this._parent)
.find(Selector.ACTIVES)
.filter(`[data-parent="${this._config.parent}"]`)
)
actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES))
.filter((elem) => elem.getAttribute('data-parent') === this._config.parent)
if (actives.length === 0) {
actives = null
}
@@ -161,7 +162,7 @@ const Collapse = (($) => {
this._element.style[dimension] = 0
if (this._triggerArray.length > 0) {
if (this._triggerArray.length) {
$(this._triggerArray)
.removeClass(ClassName.COLLAPSED)
.attr('aria-expanded', true)
@@ -216,12 +217,13 @@ const Collapse = (($) => {
.removeClass(ClassName.COLLAPSE)
.removeClass(ClassName.SHOW)
if (this._triggerArray.length > 0) {
for (let i = 0; i < this._triggerArray.length; i++) {
const triggerArrayLength = this._triggerArray.length
if (triggerArrayLength > 0) {
for (let i = 0; i < triggerArrayLength; i++) {
const trigger = this._triggerArray[i]
const selector = Util.getSelectorFromElement(trigger)
if (selector !== null) {
const $elem = $(selector)
const $elem = $([].slice.call(document.querySelectorAll(selector)))
if (!$elem.hasClass(ClassName.SHOW)) {
$(trigger).addClass(ClassName.COLLAPSED)
.attr('aria-expanded', false)
@@ -289,13 +291,14 @@ const Collapse = (($) => {
parent = this._config.parent[0]
}
} else {
parent = $(this._config.parent)[0]
parent = document.querySelector(this._config.parent)
}
const selector =
`[data-toggle="collapse"][data-parent="${this._config.parent}"]`
$(parent).find(selector).each((i, element) => {
const children = [].slice.call(parent.querySelectorAll(selector))
$(children).each((i, element) => {
this._addAriaAndCollapsedClass(
Collapse._getTargetFromElement(element),
[element]
@@ -309,7 +312,7 @@ const Collapse = (($) => {
if (element) {
const isOpen = $(element).hasClass(ClassName.SHOW)
if (triggerArray.length > 0) {
if (triggerArray.length) {
$(triggerArray)
.toggleClass(ClassName.COLLAPSED, !isOpen)
.attr('aria-expanded', isOpen)
@@ -321,7 +324,7 @@ const Collapse = (($) => {
static _getTargetFromElement(element) {
const selector = Util.getSelectorFromElement(element)
return selector ? $(selector)[0] : null
return selector ? document.querySelector(selector) : null
}
static _jQueryInterface(config) {
@@ -367,7 +370,8 @@ const Collapse = (($) => {
const $trigger = $(this)
const selector = Util.getSelectorFromElement(this)
$(selector).each(function () {
const selectors = [].slice.call(document.querySelectorAll(selector))
$(selectors).each(function () {
const $target = $(this)
const data = $target.data(DATA_KEY)
const config = data ? 'toggle' : $trigger.data()

View File

@@ -4,7 +4,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): dropdown.js
* Bootstrap (v4.1.3): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -17,7 +17,7 @@ const Dropdown = (($) => {
*/
const NAME = 'dropdown'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.dropdown'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -242,13 +242,15 @@ const Dropdown = (($) => {
_getMenuElement() {
if (!this._menu) {
const parent = Dropdown._getParentFromElement(this._element)
this._menu = $(parent).find(Selector.MENU)[0]
if (parent) {
this._menu = parent.querySelector(Selector.MENU)
}
}
return this._menu
}
_getPlacement() {
const $parentDropdown = $(this._element).parent()
const $parentDropdown = $(this._element.parentNode)
let placement = AttachmentMap.BOTTOM
// Handle dropup
@@ -284,6 +286,7 @@ const Dropdown = (($) => {
} else {
offsetConf.offset = this._config.offset
}
const popperConfig = {
placement: this._getPlacement(),
modifiers: {
@@ -333,14 +336,18 @@ const Dropdown = (($) => {
return
}
const toggles = $.makeArray($(Selector.DATA_TOGGLE))
for (let i = 0; i < toggles.length; i++) {
const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
for (let i = 0, len = toggles.length; i < len; i++) {
const parent = Dropdown._getParentFromElement(toggles[i])
const context = $(toggles[i]).data(DATA_KEY)
const relatedTarget = {
relatedTarget: toggles[i]
}
if (event && event.type === 'click') {
relatedTarget.clickEvent = event
}
if (!context) {
continue
}
@@ -382,7 +389,7 @@ const Dropdown = (($) => {
const selector = Util.getSelectorFromElement(element)
if (selector) {
parent = $(selector)[0]
parent = document.querySelector(selector)
}
return parent || element.parentNode
@@ -417,7 +424,7 @@ const Dropdown = (($) => {
if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) ||
isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (event.which === ESCAPE_KEYCODE) {
const toggle = $(parent).find(Selector.DATA_TOGGLE)[0]
const toggle = parent.querySelector(Selector.DATA_TOGGLE)
$(toggle).trigger('focus')
}
@@ -425,7 +432,7 @@ const Dropdown = (($) => {
return
}
const items = $(parent).find(Selector.VISIBLE_ITEMS).get()
const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))
if (items.length === 0) {
return

View File

@@ -13,7 +13,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): index.js
* Bootstrap (v4.1.3): index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): modal.js
* Bootstrap (v4.1.3): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@ const Modal = (($) => {
*/
const NAME = 'modal'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.modal'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -64,8 +64,7 @@ const Modal = (($) => {
DATA_TOGGLE : '[data-toggle="modal"]',
DATA_DISMISS : '[data-dismiss="modal"]',
FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
STICKY_CONTENT : '.sticky-top',
NAVBAR_TOGGLER : '.navbar-toggler'
STICKY_CONTENT : '.sticky-top'
}
/**
@@ -78,7 +77,7 @@ const Modal = (($) => {
constructor(element, config) {
this._config = this._getConfig(config)
this._element = element
this._dialog = $(element).find(Selector.DIALOG)[0]
this._dialog = element.querySelector(Selector.DIALOG)
this._backdrop = null
this._isShown = false
this._isBodyOverflowing = false
@@ -333,7 +332,7 @@ const Modal = (($) => {
this._backdrop.className = ClassName.BACKDROP
if (animate) {
$(this._backdrop).addClass(animate)
this._backdrop.classList.add(animate)
}
$(this._backdrop).appendTo(document.body)
@@ -430,46 +429,48 @@ const Modal = (($) => {
if (this._isBodyOverflowing) {
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))
// Adjust fixed content padding
$(Selector.FIXED_CONTENT).each((index, element) => {
const actualPadding = $(element)[0].style.paddingRight
$(fixedContent).each((index, element) => {
const actualPadding = element.style.paddingRight
const calculatedPadding = $(element).css('padding-right')
$(element).data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
$(element)
.data('padding-right', actualPadding)
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
})
// Adjust sticky content margin
$(Selector.STICKY_CONTENT).each((index, element) => {
const actualMargin = $(element)[0].style.marginRight
$(stickyContent).each((index, element) => {
const actualMargin = element.style.marginRight
const calculatedMargin = $(element).css('margin-right')
$(element).data('margin-right', actualMargin).css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)
})
// Adjust navbar-toggler margin
$(Selector.NAVBAR_TOGGLER).each((index, element) => {
const actualMargin = $(element)[0].style.marginRight
const calculatedMargin = $(element).css('margin-right')
$(element).data('margin-right', actualMargin).css('margin-right', `${parseFloat(calculatedMargin) + this._scrollbarWidth}px`)
$(element)
.data('margin-right', actualMargin)
.css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)
})
// Adjust body padding
const actualPadding = document.body.style.paddingRight
const calculatedPadding = $(document.body).css('padding-right')
$(document.body).data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
$(document.body)
.data('padding-right', actualPadding)
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
}
}
_resetScrollbar() {
// Restore fixed content padding
$(Selector.FIXED_CONTENT).each((index, element) => {
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
$(fixedContent).each((index, element) => {
const padding = $(element).data('padding-right')
if (typeof padding !== 'undefined') {
$(element).css('padding-right', padding).removeData('padding-right')
}
$(element).removeData('padding-right')
element.style.paddingRight = padding ? padding : ''
})
// Restore sticky content and navbar-toggler margin
$(`${Selector.STICKY_CONTENT}, ${Selector.NAVBAR_TOGGLER}`).each((index, element) => {
// Restore sticky content
const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))
$(elements).each((index, element) => {
const margin = $(element).data('margin-right')
if (typeof margin !== 'undefined') {
$(element).css('margin-right', margin).removeData('margin-right')
@@ -478,9 +479,8 @@ const Modal = (($) => {
// Restore body padding
const padding = $(document.body).data('padding-right')
if (typeof padding !== 'undefined') {
$(document.body).css('padding-right', padding).removeData('padding-right')
}
$(document.body).removeData('padding-right')
document.body.style.paddingRight = padding ? padding : ''
}
_getScrollbarWidth() { // thx d.walsh
@@ -531,7 +531,7 @@ const Modal = (($) => {
const selector = Util.getSelectorFromElement(this)
if (selector) {
target = $(selector)[0]
target = document.querySelector(selector)
}
const config = $(target).data(DATA_KEY)

View File

@@ -3,7 +3,7 @@ import Tooltip from './tooltip'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): popover.js
* Bootstrap (v4.1.3): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@ const Popover = (($) => {
*/
const NAME = 'popover'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.popover'
const EVENT_KEY = `.${DATA_KEY}`
const JQUERY_NO_CONFLICT = $.fn[NAME]

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): scrollspy.js
* Bootstrap (v4.1.3): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@ const ScrollSpy = (($) => {
*/
const NAME = 'scrollspy'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.scrollspy'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -115,7 +115,7 @@ const ScrollSpy = (($) => {
this._scrollHeight = this._getScrollHeight()
const targets = $.makeArray($(this._selector))
const targets = [].slice.call(document.querySelectorAll(this._selector))
targets
.map((element) => {
@@ -123,7 +123,7 @@ const ScrollSpy = (($) => {
const targetSelector = Util.getSelectorFromElement(element)
if (targetSelector) {
target = $(targetSelector)[0]
target = document.querySelector(targetSelector)
}
if (target) {
@@ -225,7 +225,8 @@ const ScrollSpy = (($) => {
return
}
for (let i = this._offsets.length; i--;) {
const offsetLength = this._offsets.length
for (let i = offsetLength; i--;) {
const isActiveTarget = this._activeTarget !== this._targets[i] &&
scrollTop >= this._offsets[i] &&
(typeof this._offsets[i + 1] === 'undefined' ||
@@ -249,7 +250,7 @@ const ScrollSpy = (($) => {
`${selector}[href="${target}"]`
})
const $link = $(queries.join(','))
const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)
@@ -270,7 +271,8 @@ const ScrollSpy = (($) => {
}
_clear() {
$(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE)
const nodes = [].slice.call(document.querySelectorAll(this._selector))
$(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE)
}
// Static
@@ -302,9 +304,10 @@ const ScrollSpy = (($) => {
*/
$(window).on(Event.LOAD_DATA_API, () => {
const scrollSpys = $.makeArray($(Selector.DATA_SPY))
const scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY))
for (let i = scrollSpys.length; i--;) {
const scrollSpysLength = scrollSpys.length
for (let i = scrollSpysLength; i--;) {
const $spy = $(scrollSpys[i])
ScrollSpy._jQueryInterface.call($spy, $spy.data())
}

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): tab.js
* Bootstrap (v4.1.3): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@ const Tab = (($) => {
*/
const NAME = 'tab'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.tab'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -106,7 +106,7 @@ const Tab = (($) => {
}
if (selector) {
target = $(selector)[0]
target = document.querySelector(selector)
}
this._activate(
@@ -199,7 +199,8 @@ const Tab = (($) => {
$(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]
if (dropdownElement) {
$(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)
const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE))
$(dropdownToggleList).addClass(ClassName.ACTIVE)
}
element.setAttribute('aria-expanded', true)

View File

@@ -4,7 +4,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): tooltip.js
* Bootstrap (v4.1.3): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -17,7 +17,7 @@ const Tooltip = (($) => {
*/
const NAME = 'tooltip'
const VERSION = '4.1.1'
const VERSION = '4.1.3'
const DATA_KEY = 'bs.tooltip'
const EVENT_KEY = `.${DATA_KEY}`
const JQUERY_NO_CONFLICT = $.fn[NAME]
@@ -273,7 +273,7 @@ const Tooltip = (($) => {
const attachment = this._getAttachment(placement)
this.addAttachmentClass(attachment)
const container = this.config.container === false ? document.body : $(this.config.container)
const container = this.config.container === false ? document.body : $(document).find(this.config.container)
$(tip).data(this.constructor.DATA_KEY, this)
@@ -418,9 +418,9 @@ const Tooltip = (($) => {
}
setContent() {
const $tip = $(this.getTipElement())
this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())
$tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
const tip = this.getTipElement()
this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())
$(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
}
setElementContent($element, content) {
@@ -655,14 +655,16 @@ const Tooltip = (($) => {
_cleanTipClass() {
const $tip = $(this.getTipElement())
const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)
if (tabClass !== null && tabClass.length > 0) {
if (tabClass !== null && tabClass.length) {
$tip.removeClass(tabClass.join(''))
}
}
_handlePopperPlacementChange(data) {
_handlePopperPlacementChange(popperData) {
const popperInstance = popperData.instance
this.tip = popperInstance.popper
this._cleanTipClass()
this.addAttachmentClass(this._getAttachment(data.placement))
this.addAttachmentClass(this._getAttachment(popperData.placement))
}
_fixTransition() {

View File

@@ -2,7 +2,7 @@ import $ from 'jquery'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.1): util.js
* Bootstrap (v4.1.3): util.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -82,8 +82,7 @@ const Util = (($) => {
}
try {
const $selector = $(document).find(selector)
return $selector.length > 0 ? selector : null
return document.querySelector(selector) ? selector : null
} catch (err) {
return null
}