mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
ionic restructure
This commit is contained in:
23
js/ionic-list.js
Normal file
23
js/ionic-list.js
Normal file
@ -0,0 +1,23 @@
|
||||
(function(window, document, ion) {
|
||||
ion.List = function() {}
|
||||
|
||||
ion.List.prototype._TAB_ITEM_CLASS = 'tab-item';
|
||||
|
||||
ion.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');
|
||||
}
|
||||
};
|
||||
ion.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', ion.List.prototype._onTouchStart);
|
||||
document.addEventListener('touchstart', ion.List.prototype._onTouchStart);
|
||||
document.addEventListener('touchend', ion.List.prototype._onTouchEnd);
|
||||
|
||||
})(this, document, ion = this.ion || {});
|
||||
Reference in New Issue
Block a user