|
@@ -2,7 +2,7 @@ |
|
@@ -2,7 +2,7 @@ |
2
|
* @Author: Targaryen
|
2
|
* @Author: Targaryen
|
3
|
* @Date: 2017-04-26 17:15:50
|
3
|
* @Date: 2017-04-26 17:15:50
|
4
|
* @Last Modified by: Targaryen
|
4
|
* @Last Modified by: Targaryen
|
5
|
- * @Last Modified time: 2017-04-27 11:32:13
|
5
|
+ * @Last Modified time: 2017-04-27 14:49:21
|
6
|
*/
|
6
|
*/
|
7
|
'use strict';
|
7
|
'use strict';
|
8
|
import {View} from 'yoho-mvc';
|
8
|
import {View} from 'yoho-mvc';
|
|
@@ -11,15 +11,17 @@ class NavView extends View { |
|
@@ -11,15 +11,17 @@ class NavView extends View { |
11
|
constructor() {
|
11
|
constructor() {
|
12
|
super('#guang-nav');
|
12
|
super('#guang-nav');
|
13
|
this.list = $('#info-list');
|
13
|
this.list = $('#info-list');
|
|
|
14
|
+ this.navItem = $('.guang-nav-item');
|
14
|
this.on('touchend touchcancel', 'li', this.tabClick.bind(this));
|
15
|
this.on('touchend touchcancel', 'li', this.tabClick.bind(this));
|
15
|
}
|
16
|
}
|
16
|
|
17
|
|
17
|
tabClick(e) {
|
18
|
tabClick(e) {
|
18
|
let $this = $(e.currentTarget);
|
19
|
let $this = $(e.currentTarget);
|
19
|
|
20
|
|
20
|
- // tab status change
|
|
|
21
|
- console.log($this, '------>');
|
|
|
22
|
- this.emit('navchange');
|
21
|
+ this.navItem.removeClass('focus');
|
|
|
22
|
+ $this.addClass('focus');
|
|
|
23
|
+
|
|
|
24
|
+ this.emit('navchange', $this.data('type'));
|
23
|
}
|
25
|
}
|
24
|
|
26
|
|
25
|
listChange(html) {
|
27
|
listChange(html) {
|