搜索如果有书签编辑,那么更新

This commit is contained in:
luchenqun 2017-04-14 10:50:36 +08:00
parent 77abc1be87
commit fbf7c8a002
1 changed files with 12 additions and 0 deletions

View File

@ -227,6 +227,18 @@ app.controller('searchCtr', ['$scope', '$state', '$stateParams', '$filter', '$wi
$('.ui.dropdown.js-search-tags .text').text(text); $('.ui.dropdown.js-search-tags .text').text(text);
} }
pubSubService.subscribe('EditCtr.inserBookmarsSuccess', $scope, function(event, data) {
console.log('subscribe EditCtr.inserBookmarsSuccess', JSON.stringify(data));
$scope.searchBookmarks.forEach((bookmark) => {
if(bookmark.id == data.id){
bookmark.title = data.title;
bookmark.url = data.url;
bookmark.description = data.description;
bookmark.tags = data.tags;
}
})
});
function searchBookmarks(params) { function searchBookmarks(params) {
$scope.loading = true; $scope.loading = true;
$('.js-table-search').transition('hide'); $('.js-table-search').transition('hide');