@@ -13,37 +13,23 @@ const EasterEggTrigger = {
1313 } ,
1414
1515 // Options //
16- defaultOptions : {
17- egg : {
18- callback : null ,
19- destroyBus : false ,
20- keys : false ,
21- name : 'easter-egg' ,
22- pattern : false ,
23- target : 'html' ,
24- withBus : true ,
25- } ,
26- plugin : {
27- delay : 500 ,
28- keys : [ 'ArrowUp' , 'ArrowUp' , 'ArrowDown' , 'ArrowDown' , 'ArrowLeft' , 'ArrowRight' , 'ArrowLeft' , 'ArrowRight' , 'b' , 'a' ] ,
29- mouseEvents : [
30- 'click' , // Works with multiple single clicks pattern
31- 'dblclick' , // Only works with single double click pattern set
32- 'mouseup' , // Works with multiple mouseup clicks pattern
33- 'mousedown' , // Works with multiple mousedown clicks pattern
34- ] ,
35- pattern : [ 38 , 38 , 40 , 40 , 37 , 39 , 37 , 39 , 66 , 65 ] ,
36- type : 'keydown' ,
37- } ,
16+ defaultEggOptions : {
17+ callback : null ,
18+ destroyBus : false ,
19+ keys : false ,
20+ name : 'easter-egg' ,
21+ pattern : false ,
22+ target : 'html' ,
23+ withBus : true ,
3824 } ,
3925 eggOptions : { } ,
4026 pluginOptions : { } ,
4127
4228 // Initiate Eggs //
43- init ( vue , pluginOptions , eggOptions = { } ) {
29+ init ( pluginOptions = { } , eggOptions = { } ) {
4430 // Set Options //
45- this . pluginOptions = { ... this . defaultOptions . plugin , ... pluginOptions } ;
46- this . eggOptions = { ...this . defaultOptions . egg , ...eggOptions } ;
31+ this . pluginOptions = pluginOptions ;
32+ this . eggOptions = { ...this . defaultEggOptions , ...eggOptions } ;
4733
4834 this . layEggs ( ) ;
4935 } ,
@@ -61,8 +47,8 @@ const EasterEggTrigger = {
6147 const newEgg = egg ;
6248
6349 if ( ! newEgg . keys && ! newEgg . pattern ) {
64- newEgg . keys = this . defaultOptions . plugin . keys ;
65- newEgg . pattern = this . defaultOptions . plugin . pattern ;
50+ newEgg . keys = this . pluginOptions . keys ;
51+ newEgg . pattern = this . pluginOptions . pattern ;
6652 }
6753 } ) ;
6854
@@ -93,7 +79,7 @@ const EasterEggTrigger = {
9379 }
9480
9581 // -------------------- Mouse Events //
96- if ( _ . includes ( EasterEggTrigger . defaultOptions . plugin . mouseEvents , e . type ) ) {
82+ if ( _ . includes ( EasterEggTrigger . pluginOptions . mouseEvents , e . type ) ) {
9783 key = e . type ;
9884
9985 EasterEggTrigger . targets . nodes . push ( e . target . nodeName . toLowerCase ( ) ) ;
0 commit comments