mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
simple dist, global tap listener
This commit is contained in:
61
js/events.js
61
js/events.js
@ -57,38 +57,38 @@
|
||||
gesture.off(type, callback);
|
||||
},
|
||||
|
||||
// With a click event, we need to check the target
|
||||
// and if it's an internal target that doesn't want
|
||||
// a click, cancel it
|
||||
handleClick: function(e) {
|
||||
var target = e.target;
|
||||
// // With a click event, we need to check the target
|
||||
// // and if it's an internal target that doesn't want
|
||||
// // a click, cancel it
|
||||
// handleClick: function(e) {
|
||||
// var target = e.target;
|
||||
|
||||
if(ionic.Gestures.HAS_TOUCHEVENTS) {
|
||||
// We don't allow any clicks on mobile
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
// if(ionic.Gestures.HAS_TOUCHEVENTS) {
|
||||
// // We don't allow any clicks on mobile
|
||||
// e.preventDefault();
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (
|
||||
! target
|
||||
|| e.which > 1
|
||||
|| e.metaKey
|
||||
|| e.ctrlKey
|
||||
//|| isScrolling
|
||||
// || location.protocol !== target.protocol
|
||||
// || location.host !== target.host
|
||||
// // Not sure abotu this one
|
||||
// //|| !target.hash && /#/.test(target.href)
|
||||
// || target.hash && target.href.replace(target.hash, '') === location.href.replace(location.hash, '')
|
||||
//|| target.getAttribute('data-ignore') == 'push'
|
||||
) {
|
||||
// Allow it
|
||||
return;
|
||||
}
|
||||
// We need to cancel this one
|
||||
e.preventDefault();
|
||||
// if (
|
||||
// ! target
|
||||
// || e.which > 1
|
||||
// || e.metaKey
|
||||
// || e.ctrlKey
|
||||
// //|| isScrolling
|
||||
// // || location.protocol !== target.protocol
|
||||
// // || location.host !== target.host
|
||||
// // // Not sure abotu this one
|
||||
// // //|| !target.hash && /#/.test(target.href)
|
||||
// // || target.hash && target.href.replace(target.hash, '') === location.href.replace(location.hash, '')
|
||||
// //|| target.getAttribute('data-ignore') == 'push'
|
||||
// ) {
|
||||
// // Allow it
|
||||
// return;
|
||||
// }
|
||||
// // We need to cancel this one
|
||||
// e.preventDefault();
|
||||
|
||||
},
|
||||
// },
|
||||
|
||||
handlePopState: function(event) {
|
||||
console.log("EVENT: popstate", event);
|
||||
@ -103,7 +103,8 @@
|
||||
ionic.onGesture = function() { ionic.EventController.onGesture.apply(ionic.EventController.onGesture, arguments); }
|
||||
ionic.offGesture = function() { ionic.EventController.offGesture.apply(ionic.EventController.offGesture, arguments); }
|
||||
|
||||
// DISABLING FOR NOW. THE TAP CODE AT THE EXT LEVEL SHOULD BE DOING THIS
|
||||
// Set up various listeners
|
||||
window.addEventListener('click', ionic.EventController.handleClick);
|
||||
//window.addEventListener('click', ionic.EventController.handleClick);
|
||||
|
||||
})(window.ionic);
|
||||
|
||||
Reference in New Issue
Block a user