This commit is contained in:
Max Lynch
2013-08-24 20:46:31 -05:00
parent d9f1c23ee1
commit 9a660ccb00
10 changed files with 179 additions and 13 deletions

View File

@ -0,0 +1,23 @@
(function(window, document, framework) {
framework.Tabs = function() {}
framework.List.prototype._TAB_ITEM_CLASS = 'tab-item';
framework.List.prototype._onTouchStart = function(event) {
console.log('Touch start!', event);
if(event.target && event.target.parentNode.classList.contains(this._TAB_ITEM_CLASS)) {
event.target.classList.add('active');
}
};
framework.List.prototype._onTouchEnd = function(event) {
console.log('Touch end!', event);
if(event.target && event.target.parentNode.classList.contains(this._TAB_ITEM_CLASS)) {
event.target.classList.remove('active');
}
};
document.addEventListener('mousedown', framework.Tabs.prototype._onTouchStart);
document.addEventListener('touchstart', framework.Tabs.prototype._onTouchStart);
document.addEventListener('touchend', framework.Tabs.prototype._onTouchEnd);
})(this, document, this.FM = this.FM || {});