()
| 301 | } |
| 302 | |
| 303 | init() { |
| 304 | try { |
| 305 | this._triggeringElement = document.activeElement; |
| 306 | } catch (err) { |
| 307 | this._triggeringElement = null; |
| 308 | } |
| 309 | |
| 310 | if (!this._element) { |
| 311 | this._element = document.createElement('div'); |
| 312 | this._element.setAttribute('tabindex', '-1'); |
| 313 | this._element.style.position = 'relative'; |
| 314 | this._element.style.zIndex = this.props.zIndex; |
| 315 | this._mountContainer = getTarget(this.props.container); |
| 316 | this._mountContainer.appendChild(this._element); |
| 317 | } |
| 318 | |
| 319 | this._originalBodyPadding = getOriginalBodyPadding(); |
| 320 | conditionallyUpdateScrollbar(); |
| 321 | |
| 322 | if ( |
| 323 | Offcanvas.openCount === 0 && |
| 324 | this.props.backdrop && |
| 325 | !this.props.scrollable |
| 326 | ) { |
| 327 | document.body.style.overflow = 'hidden'; |
| 328 | } |
| 329 | |
| 330 | this.offcanvasIndex = Offcanvas.openCount; |
| 331 | Offcanvas.openCount += 1; |
| 332 | } |
| 333 | |
| 334 | destroy() { |
| 335 | if (this._element) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…