File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable no-undef */
22
3+ const name = 'slotMachine' ;
4+
35class 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 */
1315function _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 ) ;
Original file line number Diff line number Diff line change @@ -20,11 +20,7 @@ const FX_TURTLE = 'slotMachineBlurTurtle';
2020const FX_GRADIENT = 'slotMachineGradient' ;
2121const 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 ;
You can’t perform that action at this time.
0 commit comments