mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 15:51:16 +08:00
Event unit and some minor cleanups
This commit is contained in:
@ -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);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user