Skip to content

Commit 99705ac

Browse files
author
Narendra Sisodiya
committed
fix bug realated to triggering customEvent
1 parent 86e612b commit 99705ac

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

dist/pitana.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@
199199
ele.addEventListener(eventName, callback, false);
200200
return callback;
201201
},
202-
trigger: function(target, type, options) {
202+
trigger: function(target, type, detail, options) {
203203
if (options === undefined) {
204204
options = {};
205205
}
206206
var event = document.createEvent("CustomEvent");
207-
event.initCustomEvent(type, options.bubbles !== false, options.cancelable !== false);
207+
event.initCustomEvent(type, options.bubbles !== false, options.cancelable !== false, detail);
208208
target.dispatchEvent(event);
209209
}
210210
};
@@ -312,9 +312,9 @@
312312
delete this._viewMetadata.eventsMap[key];
313313
}
314314
},
315-
trigger: function(eventName) {
315+
trigger: function(eventName, detail) {
316316
//Default Trigger will be on this.$ which is our custom event.
317-
pitana.domEvents.trigger(this.$, eventName);
317+
pitana.domEvents.trigger(this.$, eventName, detail);
318318
},
319319
_endModule: function() {
320320

dist/pitana.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pitana.HTMLElement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
delete this._viewMetadata.eventsMap[key];
102102
}
103103
},
104-
trigger: function(eventName) {
104+
trigger: function(eventName, detail) {
105105
//Default Trigger will be on this.$ which is our custom event.
106-
pitana.domEvents.trigger(this.$, eventName);
106+
pitana.domEvents.trigger(this.$, eventName, detail);
107107
},
108108
_endModule: function() {
109109

src/pitana.domEvents.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
ele.addEventListener(eventName, callback, false);
3131
return callback;
3232
},
33-
trigger: function(target, type, options) {
33+
trigger: function(target, type, detail, options) {
3434
if (options === undefined) {
3535
options = {};
3636
}
3737
var event = document.createEvent("CustomEvent");
38-
event.initCustomEvent(type, options.bubbles !== false, options.cancelable !== false);
38+
event.initCustomEvent(type, options.bubbles !== false, options.cancelable !== false, detail);
3939
target.dispatchEvent(event);
4040
}
4141
};

0 commit comments

Comments
 (0)