1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-08 22:56:46 +02:00

Refactor scrollbar.js to be used as a Class (#33947)

This commit is contained in:
GeoSot
2021-06-06 09:26:36 +03:00
committed by GitHub
parent 08139c2280
commit cb47b8c964
6 changed files with 141 additions and 118 deletions

View File

@@ -12,7 +12,7 @@ import {
isVisible,
typeCheckConfig
} from './util/index'
import { hide as scrollBarHide, reset as scrollBarReset } from './util/scrollbar'
import ScrollBarHelper from './util/scrollbar'
import EventHandler from './dom/event-handler'
import BaseComponent from './base-component'
import SelectorEngine from './dom/selector-engine'
@@ -108,7 +108,7 @@ class Offcanvas extends BaseComponent {
this._backdrop.show()
if (!this._config.scroll) {
scrollBarHide()
new ScrollBarHelper().hide()
this._enforceFocusOnElement(this._element)
}
@@ -148,7 +148,7 @@ class Offcanvas extends BaseComponent {
this._element.style.visibility = 'hidden'
if (!this._config.scroll) {
scrollBarReset()
new ScrollBarHelper().reset()
}
EventHandler.trigger(this._element, EVENT_HIDDEN)