Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
Pluginn events now bubbles
  • Loading branch information
LCweb-ita committed Mar 18, 2021
1 parent 735f8c1 commit e0b4827
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions lc_switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* LC Switch
* superlight pure javascript plugin improving forms look and functionality
*
* @version: 2.0.2
* @version: 2.0.3
* @author: Luca Montanari (LCweb)
* @website: https://lcweb.it
Expand Down Expand Up @@ -258,8 +258,8 @@

// trigger events
if(!forced_action) {
const lcsOnEvent = new Event("lcs-on"),
lcsStatusChangeEvent = new Event('lcs-statuschange');
const lcsOnEvent = new Event("lcs-on", {bubbles:true}),
lcsStatusChangeEvent = new Event('lcs-statuschange', {bubbles:true});

el.dispatchEvent(lcsOnEvent);
el.dispatchEvent(lcsStatusChangeEvent);
Expand Down Expand Up @@ -294,8 +294,8 @@

// trigger events
if(!forced_action) {
const lcsOffEvent = new Event("lcs-off"),
lcsStatusChangeEvent = new Event('lcs-statuschange');
const lcsOffEvent = new Event("lcs-off", {bubbles:true}),
lcsStatusChangeEvent = new Event('lcs-statuschange', {bubbles:true});

el.dispatchEvent(lcsOffEvent);
el.dispatchEvent(lcsStatusChangeEvent);
Expand Down Expand Up @@ -335,8 +335,8 @@
el.previousElementSibling.classList.add('lcs_disabled');

// trigger events
const lcsDisabledEvent = new Event("lcs-disabled"),
lcsStatusChangeEvent = new Event('lcs-statuschange');
const lcsDisabledEvent = new Event("lcs-disabled", {bubbles:true}),
lcsStatusChangeEvent = new Event('lcs-statuschange', {bubbles:true});

el.dispatchEvent(lcsDisabledEvent);
el.dispatchEvent(lcsStatusChangeEvent);
Expand All @@ -357,8 +357,8 @@
el.previousElementSibling.classList.remove('lcs_disabled');

// trigger events
const lcsEnabledEvent = new Event("lcs-enabled"),
lcsStatusChangeEvent = new Event('lcs-statuschange');
const lcsEnabledEvent = new Event("lcs-enabled", {bubbles:true}),
lcsStatusChangeEvent = new Event('lcs-statuschange', {bubbles:true});

el.dispatchEvent(lcsEnabledEvent);
el.dispatchEvent(lcsStatusChangeEvent);
Expand Down
12 changes: 6 additions & 6 deletions lc_switch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "LCweb",
"name": "lc-switch",
"version": "2.0.2",
"version": "2.0.3",
"description": "Superlight vanilla javascript plugin improving forms look and functionality",
"keywords": [
"javascript",
Expand Down

0 comments on commit e0b4827

Please sign in to comment.