2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-30 15:24:08 +03:00

Be SSR friendly when accessing DOM objects

This commit is contained in:
Johann-S
2021-02-17 09:22:44 +02:00
committed by XhmikosR
parent c44d99f55c
commit 8306213650
23 changed files with 203 additions and 70 deletions
+8 -1
View File
@@ -6,7 +6,12 @@
*/
import Data from './dom/data'
import { executeAfterTransition, getElement } from './util/index'
import {
executeAfterTransition,
getElement,
getWindow,
getDocument
} from './util/index'
import EventHandler from './dom/event-handler'
import Config from './util/config'
@@ -30,6 +35,8 @@ class BaseComponent extends Config {
}
this._element = element
this._window = getWindow()
this._document = getDocument()
this._config = this._getConfig(config)
Data.set(this._element, this.constructor.DATA_KEY, this)