diff options
| author | XhmikosR <[email protected]> | 2020-07-08 20:09:39 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-09-21 14:58:34 +0300 |
| commit | b31046aab36ea1e476ff384f585ef650c8158d1e (patch) | |
| tree | 1f88c461bb248b1dd8876a106e16a52996329822 /js/src/collapse.js | |
| parent | c86b74fe88318cd4483c148a560742b0d2ed6f65 (diff) | |
| download | bootstrap-b31046aab36ea1e476ff384f585ef650c8158d1e.tar.xz bootstrap-b31046aab36ea1e476ff384f585ef650c8158d1e.zip | |
Cache a few variables.
Diffstat (limited to 'js/src/collapse.js')
| -rw-r--r-- | js/src/collapse.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js index 04653b835..605299515 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -324,11 +324,11 @@ class Collapse { static _jQueryInterface(config) { return this.each(function () { - const $this = $(this) - let data = $this.data(DATA_KEY) + const $element = $(this) + let data = $element.data(DATA_KEY) const _config = { ...Default, - ...$this.data(), + ...$element.data(), ...typeof config === 'object' && config ? config : {} } @@ -338,7 +338,7 @@ class Collapse { if (!data) { data = new Collapse(this, _config) - $this.data(DATA_KEY, data) + $element.data(DATA_KEY, data) } if (typeof config === 'string') { |
