view.js
412 Bytes
import {
View
} from 'yoho-mvc';
class TabView extends View {
constructor() {
super('.tab');
this.on('touchend touchcancel', 'span', this.tabClick.bind(this));
}
tabClick(e) {
let $this = $(e.currentTarget);
if (!$this.hasClass('active')) {
$this.addClass('active').siblings('span').removeClass('active');
}
}
}
export {
TabView
};