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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user