1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-28 22:39:11 +02:00

add getters for Version and Default where applicable

add modal my gawd
This commit is contained in:
fat
2015-05-10 19:45:38 -07:00
parent bbb97a8660
commit ca9c850ebb
29 changed files with 1114 additions and 1153 deletions

View File

@@ -23,7 +23,7 @@ const Collapse = (($) => {
const JQUERY_NO_CONFLICT = $.fn[NAME]
const TRANSITION_DURATION = 600
const Defaults = {
const Default = {
toggle : true,
parent : null
}
@@ -63,10 +63,9 @@ const Collapse = (($) => {
class Collapse {
constructor(element, config) {
this._isTransitioning = false
this._element = element
this._config = $.extend({}, Defaults, config)
this._config = $.extend({}, Default, config)
this._triggerArray = $.makeArray($(
`[data-toggle="collapse"][href="#${element.id}"],` +
`[data-toggle="collapse"][data-target="#${element.id}"]`
@@ -81,9 +80,20 @@ const Collapse = (($) => {
if (this._config.toggle) {
this.toggle()
}
}
// getters
static get VERSION() {
return VERSION
}
static get Default() {
return Default
}
// public
toggle() {
@@ -284,7 +294,7 @@ const Collapse = (($) => {
let data = $this.data(DATA_KEY)
let _config = $.extend(
{},
Defaults,
Default,
$this.data(),
typeof config === 'object' && config
)