mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
Android active state hack
This commit is contained in:
20
js/framework/framework-buttons.js
Normal file
20
js/framework/framework-buttons.js
Normal file
@ -0,0 +1,20 @@
|
||||
(function(window, document, framework) {
|
||||
framework.Button = function() {}
|
||||
|
||||
framework.Button.prototype._onTouchStart = function(event) {
|
||||
console.log('Touch start!', event);
|
||||
if(event.target && event.target.classList.contains('button')) {
|
||||
event.target.classList.add('active');
|
||||
}
|
||||
};
|
||||
framework.Button.prototype._onTouchEnd = function(event) {
|
||||
console.log('Touch end!', event);
|
||||
if(event.target && event.target.classList.contains('button')) {
|
||||
event.target.classList.remove('active');
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('touchstart', framework.Button.prototype._onTouchStart);
|
||||
document.addEventListener('touchend', framework.Button.prototype._onTouchEnd);
|
||||
|
||||
})(this, document, this.FM = this.FM || {});
|
||||
Reference in New Issue
Block a user