|
@@ -106,6 +106,14 @@ var vm = new Vue({
|
|
|
}
|
|
|
return arr.join('&')
|
|
|
},
|
|
|
+ scrollTo: function (scrollTop, animate) {
|
|
|
+ var jMain = this.$refs.jMain
|
|
|
+ if (animate) {
|
|
|
+ $(jMain).animate({ scrollTop: scrollTop }, 300)
|
|
|
+ } else {
|
|
|
+ $(jMain).scrollTop(scrollTop)
|
|
|
+ }
|
|
|
+ },
|
|
|
getKeywordsGroupList: function (needLoading) {
|
|
|
var _this = this
|
|
|
if (needLoading) {
|
|
@@ -130,7 +138,7 @@ var vm = new Vue({
|
|
|
_this.filter.allKeywordsList = _this.filterKeywordsList()
|
|
|
if (needLoading && _this.scrollTop != 0) {
|
|
|
_this.$nextTick(function () {
|
|
|
- $(_this.$refs.jMain).animate({ scrollTop: _this.scrollTop }, 300)
|
|
|
+ _this.scrollTo(_this.scrollTop)
|
|
|
_this.scrollTop = 0
|
|
|
})
|
|
|
}
|
|
@@ -229,9 +237,13 @@ var vm = new Vue({
|
|
|
this.showFilterPicker(false)
|
|
|
},
|
|
|
doFilter: function (groupName) {
|
|
|
+ var _this = this
|
|
|
this.filter.groupName = groupName
|
|
|
var rList = this.filterKeywordsList(groupName)
|
|
|
this.filter.keywordsList = rList
|
|
|
+ this.$nextTick(function () {
|
|
|
+ _this.scrollTo(0)
|
|
|
+ })
|
|
|
},
|
|
|
// 筛选分类列表
|
|
|
filterKeywordsList: function (filterName) {
|
|
@@ -491,7 +503,9 @@ var vm = new Vue({
|
|
|
savePageState: function () {
|
|
|
this.scrollTop = $(this.$refs.jMain).scrollTop()
|
|
|
var data = {
|
|
|
- filter: this.filter,
|
|
|
+ filter: {
|
|
|
+ groupName: this.filter.groupName
|
|
|
+ },
|
|
|
scrollTop: this.scrollTop
|
|
|
}
|
|
|
sessionStorage.setItem(this.conf.sessKey, JSON.stringify(data))
|