0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-06 04:08:22 +01:00

Unbreak lines and remove a TODO comment

This commit is contained in:
XhmikosR 2020-09-18 10:39:21 +03:00
parent be18957933
commit c86b74fe88
3 changed files with 4 additions and 10 deletions

View File

@ -59,17 +59,14 @@ class Button {
toggle() { toggle() {
let triggerChangeEvent = true let triggerChangeEvent = true
let addAriaPressed = true let addAriaPressed = true
const rootElement = $(this._element).closest( const rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0]
SELECTOR_DATA_TOGGLES
)[0]
if (rootElement) { if (rootElement) {
const input = this._element.querySelector(SELECTOR_INPUT) const input = this._element.querySelector(SELECTOR_INPUT)
if (input) { if (input) {
if (input.type === 'radio') { if (input.type === 'radio') {
if (input.checked && if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
this._element.classList.contains(CLASS_NAME_ACTIVE)) {
triggerChangeEvent = false triggerChangeEvent = false
} else { } else {
const activeElement = rootElement.querySelector(SELECTOR_ACTIVE) const activeElement = rootElement.querySelector(SELECTOR_ACTIVE)
@ -96,8 +93,7 @@ class Button {
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
if (addAriaPressed) { if (addAriaPressed) {
this._element.setAttribute('aria-pressed', this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE))
!this._element.classList.contains(CLASS_NAME_ACTIVE))
} }
if (triggerChangeEvent) { if (triggerChangeEvent) {

View File

@ -453,8 +453,7 @@ class Modal {
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
_adjustDialog() { _adjustDialog() {
const isModalOverflowing = const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
this._element.scrollHeight > document.documentElement.clientHeight
if (!this._isBodyOverflowing && isModalOverflowing) { if (!this._isBodyOverflowing && isModalOverflowing) {
this._element.style.paddingLeft = `${this._scrollbarWidth}px` this._element.style.paddingLeft = `${this._scrollbarWidth}px`

View File

@ -125,7 +125,6 @@ const Util = {
$(element).trigger(TRANSITION_END) $(element).trigger(TRANSITION_END)
}, },
// TODO: Remove in v5
supportsTransitionEnd() { supportsTransitionEnd() {
return Boolean(TRANSITION_END) return Boolean(TRANSITION_END)
}, },