mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Update
This commit is contained in:
23
js/framework/framework-list.js
Normal file
23
js/framework/framework-list.js
Normal 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 || {});
|
||||
Reference in New Issue
Block a user