From 25d93ab6ade33993777716dfe0e0f31e7ee0b9d9 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Wed, 3 Oct 2018 09:34:17 +0000 Subject: [PATCH] Travis build: 583 --- README.md | 4 ++-- docs/browser.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e8ec39467..3c5ca8629 100644 --- a/README.md +++ b/README.md @@ -4153,8 +4153,8 @@ Use `el.dispatchEvent()` to trigger the newly created event on the given element Omit the third argument, `detail`, if you do not want to pass custom data to the triggered event. ```js -const triggerEvent = (el, eventType, detail = undefined) => - el.dispatchEvent(new CustomEvent(eventType, { detail: detail })); +const triggerEvent = (el, eventType, detail) => + el.dispatchEvent(new CustomEvent(eventType, { detail })); ```
diff --git a/docs/browser.html b/docs/browser.html index 49075c26d..36bfe3f1e 100644 --- a/docs/browser.html +++ b/docs/browser.html @@ -367,8 +367,8 @@ recorder.sta smoothScroll('.fooBar'); // scrolls smoothly to the first element with a class of fooBar

toggleClass

Toggle a class for an element.

Use element.classList.toggle() to toggle the specified class for the element.

const toggleClass = (el, className) => el.classList.toggle(className);
 
toggleClass(document.querySelector('p.special'), 'special'); // The paragraph will not have the 'special' class anymore
-

triggerEvent

Triggers a specific event on a given element, optionally passing custom data.

Use new CustomEvent() to create an event from the specified eventType and details. Use el.dispatchEvent() to trigger the newly created event on the given element. Omit the third argument, detail, if you do not want to pass custom data to the triggered event.

const triggerEvent = (el, eventType, detail = undefined) =>
-  el.dispatchEvent(new CustomEvent(eventType, { detail: detail }));
+

triggerEvent

Triggers a specific event on a given element, optionally passing custom data.

Use new CustomEvent() to create an event from the specified eventType and details. Use el.dispatchEvent() to trigger the newly created event on the given element. Omit the third argument, detail, if you do not want to pass custom data to the triggered event.

const triggerEvent = (el, eventType, detail) =>
+  el.dispatchEvent(new CustomEvent(eventType, { detail }));
 
triggerEvent(document.getElementById('myId'), 'click');
 triggerEvent(document.getElementById('myId'), 'click', { username: 'bob' });
 

UUIDGeneratorBrowser

Generates a UUID in a browser.

Use crypto API to generate a UUID, compliant with RFC4122 version 4.

const UUIDGeneratorBrowser = () =>