Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 43fe8b9

Browse files
author
Scott J. Miles
committed
Ref #646
1 parent 8f8ecc1 commit 43fe8b9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/instance/utils.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@
4848
* @param {string} type An event name.
4949
* @param {any} detail
5050
* @param {Node} onNode Target node.
51+
* @param {Boolean} bubbles Set false to prevent bubbling, defaults to true
52+
* @param {Boolean} cancelable Set false to prevent cancellation, defaults to true
5153
*/
5254
fire: function(type, detail, onNode, bubbles, cancelable) {
5355
var node = onNode || this;
54-
var detail = detail || {};
56+
var detail = detail === null || detail === undefined ? {} : detail;
5557
var event = new CustomEvent(type, {
56-
bubbles: (bubbles !== undefined ? bubbles : true),
57-
cancelable: (cancelable !== undefined ? cancelable : true),
58+
bubbles: bubbles !== undefined ? bubbles : true,
59+
cancelable: cancelable !== undefined ? cancelable : true,
5860
detail: detail
5961
});
6062
node.dispatchEvent(event);

0 commit comments

Comments
 (0)