Authored by 郭成尧

nav-change

... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-04-26 17:19:19
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-27 11:29:34
* @Last Modified time: 2017-04-27 14:48:55
*/
'use strict';
... ... @@ -22,9 +22,7 @@ class IndexController extends Controller {
this.navView.on('navchange', this.fetchList.bind(this));
}
fetchList(e) {
let type = $(e).data('type');
fetchList(e, type) {
this.guangModel.loadMore({
type: type
}).then(result => {
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-04-26 17:15:50
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-27 11:32:13
* @Last Modified time: 2017-04-27 14:49:21
*/
'use strict';
import {View} from 'yoho-mvc';
... ... @@ -11,15 +11,17 @@ class NavView extends View {
constructor() {
super('#guang-nav');
this.list = $('#info-list');
this.navItem = $('.guang-nav-item');
this.on('touchend touchcancel', 'li', this.tabClick.bind(this));
}
tabClick(e) {
let $this = $(e.currentTarget);
// tab status change
console.log($this, '------>');
this.emit('navchange');
this.navItem.removeClass('focus');
$this.addClass('focus');
this.emit('navchange', $this.data('type'));
}
listChange(html) {
... ...