mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -9,9 +9,11 @@
|
||||
ionic.activator = {
|
||||
|
||||
start: function(e) {
|
||||
|
||||
// when an element is touched/clicked, it climbs up a few
|
||||
// parents to see if it is an .item or .button element
|
||||
ionic.requestAnimationFrame(function(){
|
||||
if (tapRequiresNativeClick(e.target)) return;
|
||||
var ele = e.target;
|
||||
var eleToActivate;
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ describe('Ionic Element Activator', function() {
|
||||
window.setTimeout = ionic.requestAnimationFrame = function(cb) { cb(); };
|
||||
});
|
||||
|
||||
it('should not active an <a> if tapRequiresNativeClick is true', function() {
|
||||
spyOn(window, 'tapRequiresNativeClick').andReturn(true);
|
||||
var e = { target: document.createElement('a') };
|
||||
ionic.activator.start(e);
|
||||
expect(e.target.classList.contains('activated')).toEqual(false);
|
||||
});
|
||||
|
||||
it('Should activate an <a>', function() {
|
||||
var e = { target: document.createElement('a') };
|
||||
ionic.activator.start(e);
|
||||
|
||||
Reference in New Issue
Block a user