Android active state hack

This commit is contained in:
Max Lynch
2013-08-23 18:31:41 -05:00
parent 289d7afdec
commit a1b2269e6d
5 changed files with 30 additions and 10 deletions

View 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 || {});