diff --git a/dist/ionic.js b/dist/ionic.js index 15a752b57a..c1cac84d18 100644 --- a/dist/ionic.js +++ b/dist/ionic.js @@ -100,7 +100,7 @@ if ( document.readyState === "complete" ) { * detects special events like tap/swipe/etc. and emits them * as custom events that can be used in an app. * - * Portions lovingly adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys! + * Portions adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys! */ (function(ionic) { @@ -109,9 +109,7 @@ if ( document.readyState === "complete" ) { // Trigger a new event trigger: function(eventType, data) { - // TODO: Do we need to use the old-school createEvent stuff? var event = new CustomEvent(eventType, data); - // Make sure to trigger the event on the given target, or dispatch it from // the window if we don't have an event target data.target && data.target.dispatchEvent(event) || window.dispatchEvent(event); @@ -182,10 +180,6 @@ if ( document.readyState === "complete" ) { e.preventDefault(); }, - - handlePopState: function(event) { - console.log("EVENT: popstate", event); - }, }; diff --git a/js/events.js b/js/events.js index 62f03f992b..b624ff68cc 100644 --- a/js/events.js +++ b/js/events.js @@ -7,7 +7,7 @@ * detects special events like tap/swipe/etc. and emits them * as custom events that can be used in an app. * - * Portions lovingly adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys! + * Portions adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys! */ (function(ionic) { @@ -16,9 +16,7 @@ // Trigger a new event trigger: function(eventType, data) { - // TODO: Do we need to use the old-school createEvent stuff? var event = new CustomEvent(eventType, data); - // Make sure to trigger the event on the given target, or dispatch it from // the window if we don't have an event target data.target && data.target.dispatchEvent(event) || window.dispatchEvent(event); @@ -89,10 +87,6 @@ e.preventDefault(); }, - - handlePopState: function(event) { - console.log("EVENT: popstate", event); - }, }; diff --git a/test/js/events.unit.js b/test/js/events.unit.js index cf4c5c1d4f..980f259f3c 100644 --- a/test/js/events.unit.js +++ b/test/js/events.unit.js @@ -1,6 +1,9 @@ describe('Ionic Events', function() { it('Should block all click events', function() { var a = document.createElement('a'); - a.click(); + + ionic.trigger('click', { + target: a + }); }); });