初始化历史搜索时机
This commit is contained in:
parent
3e917ca341
commit
c2d42d97d2
|
|
@ -205,18 +205,6 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
bookmarkService.userInfo({})
|
||||
.then((data) => {
|
||||
$scope.searchHistory = JSON.parse(data.search_history || '[]');
|
||||
var count = 1;
|
||||
var id = setInterval(function() {
|
||||
var items = $('.search-item').popup({
|
||||
on: 'focus',
|
||||
inline: true
|
||||
});
|
||||
console.log("searchHistory = ", items.length, JSON.stringify(data.search_history));
|
||||
count++;
|
||||
if (items.length >= 1 || count >= 20) {
|
||||
clearInterval(id);
|
||||
}
|
||||
}, 200);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
|
|
|
|||
|
|
@ -177,6 +177,11 @@ app.directive('jsMenuInit', function($compile) {
|
|||
$('.ui.menu a.item').on('click', function() {
|
||||
$(this).addClass('selected').siblings().removeClass('selected');
|
||||
});
|
||||
|
||||
$('.search-item').popup({
|
||||
on: 'focus',
|
||||
inline: true
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue