From b31046aab36ea1e476ff384f585ef650c8158d1e Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 8 Jul 2020 20:09:39 +0300 Subject: Cache a few variables. --- js/src/button.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/src/button.js') diff --git a/js/src/button.js b/js/src/button.js index b244c8df4..d79378582 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -111,11 +111,12 @@ class Button { static _jQueryInterface(config) { return this.each(function () { - let data = $(this).data(DATA_KEY) + const $element = $(this) + let data = $element.data(DATA_KEY) if (!data) { data = new Button(this) - $(this).data(DATA_KEY, data) + $element.data(DATA_KEY, data) } if (config === 'toggle') { -- cgit v1.2.3