mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Lots of tweaks, and angular demos
This commit is contained in:
@ -1,20 +1,23 @@
|
||||
(function(window, document, framework) {
|
||||
framework.Tabs = function() {}
|
||||
|
||||
framework.Tabs.prototype._TAB_ITEM_CLASS = 'tab-item';
|
||||
|
||||
framework.Tabs.prototype._onTouchStart = function(event) {
|
||||
console.log('Touch start!', event);
|
||||
if(event.target && event.target.classList.contains('button')) {
|
||||
if(event.target && event.target.parentNode.classList.contains(this._TAB_ITEM_CLASS)) {
|
||||
event.target.classList.add('active');
|
||||
}
|
||||
};
|
||||
framework.Tabs.prototype._onTouchEnd = function(event) {
|
||||
console.log('Touch end!', event);
|
||||
if(event.target && event.target.classList.contains('button')) {
|
||||
if(event.target && event.target.parentNode.classList.contains(this._TAB_ITEM_CLASS)) {
|
||||
event.target.classList.remove('active');
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('touchstart', framework.Button.prototype._onTouchStart);
|
||||
document.addEventListener('touchend', framework.Button.prototype._onTouchEnd);
|
||||
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