用一个流氓办法确保显示历史搜索记录
This commit is contained in:
parent
0dcc25b1a1
commit
a8f8a29cfb
|
|
@ -187,14 +187,17 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
||||||
bookmarkService.userInfo({})
|
bookmarkService.userInfo({})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
$scope.searchHistory = JSON.parse(data.search_history || '[]');
|
$scope.searchHistory = JSON.parse(data.search_history || '[]');
|
||||||
for (var i = 1; i <= 100; i += 10) {
|
var count = 1;
|
||||||
$timeout(function() {
|
var id = setInterval(function () {
|
||||||
$('.search-item').popup({
|
var items = $('.search-item').popup({
|
||||||
on: 'focus',
|
on: 'focus',
|
||||||
inline: true
|
inline: true
|
||||||
});
|
});
|
||||||
}, 100 * i)
|
console.log("searchHistory = ", items.length);
|
||||||
}
|
if (items.length >= 1 || count >= 20) {
|
||||||
|
clearInterval(id);
|
||||||
|
}
|
||||||
|
}, 200);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
toastr.error('获取信息失败。错误信息:' + JSON.stringify(err), "错误");
|
toastr.error('获取信息失败。错误信息:' + JSON.stringify(err), "错误");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue