Skip to content

Commit d63de0d

Browse files
committed
remove static property
1 parent 69bfe62 commit d63de0d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/jquery.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/* eslint-disable no-undef */
22

3+
const name = 'slotMachine';
4+
35
class JQuerySlotMachine extends SlotMachine {
46
destroy () {
57
super.destroy();
6-
$.data(this.element[0], 'plugin_' + this.name, null);
8+
$.data(this.element[0], 'plugin_' + name, null);
79
}
810
}
911

@@ -12,19 +14,19 @@ class JQuerySlotMachine extends SlotMachine {
1214
*/
1315
function _getInstance (element, options) {
1416
let machine;
15-
if (!$.data(element[0], 'plugin_' + SlotMachine.name)) {
17+
if (!$.data(element[0], 'plugin_' + name)) {
1618
machine = new JQuerySlotMachine(element[0], options);
17-
$.data(element[0], 'plugin_' + machine.name, machine);
19+
$.data(element[0], 'plugin_' + name, machine);
1820
} else {
19-
machine = $.data(element[0], 'plugin_' + SlotMachine.name);
21+
machine = $.data(element[0], 'plugin_' + name);
2022
}
2123
return machine;
2224
}
2325

2426
/*
2527
* Chainable instance
2628
*/
27-
$.fn[SlotMachine.name] = function initPlugin (options) {
29+
$.fn[name] = function initPlugin (options) {
2830
let instances;
2931
if (this.length === 1) {
3032
instances = _getInstance(this, options);

lib/slot-machine.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ const FX_TURTLE = 'slotMachineBlurTurtle';
2020
const FX_GRADIENT = 'slotMachineGradient';
2121
const FX_STOP = FX_GRADIENT;
2222

23-
module.exports = class SlotMachine {
24-
static get name () {
25-
return 'slotMachine';
26-
}
27-
23+
class SlotMachine {
2824
constructor (element, options) {
2925
this.element = element;
3026
// Slot Machine elements
@@ -406,3 +402,5 @@ module.exports = class SlotMachine {
406402
this.container.remove();
407403
}
408404
}
405+
406+
module.exports = SlotMachine;

0 commit comments

Comments
 (0)