数据点击之后,在表格里面实时更新
This commit is contained in:
parent
b3a908e0fa
commit
a7b8d9d31d
|
|
@ -55,13 +55,27 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($scope.showStyle != 'navigate') {
|
if ($scope.showStyle != 'navigate') {
|
||||||
$scope.bookmarkData.bookmarks.forEach(function(bookmark) {
|
var bookmarks = $scope.showStyle == 'table' ? $scope.bookmarkData.bookmarks : $scope.bookmarkData;
|
||||||
|
bookmarks.forEach(function(bookmark) {
|
||||||
if (bookmark.id == id) {
|
if (bookmark.id == id) {
|
||||||
bookmark.click_count += 1;
|
bookmark.click_count += 1;
|
||||||
bookmark.last_click = $filter("date")(new Date(), "yyyy-MM-dd HH:mm:ss");
|
bookmark.last_click = $filter("date")(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($scope.showStyle == 'table') {
|
||||||
|
$scope.changeOrder($scope.order.indexOf(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($scope.showStyle == 'costomTag') {
|
||||||
|
$scope.costomTags.forEach((tag) => {
|
||||||
|
if (tag.clicked) {
|
||||||
|
$scope.updateCostomTagBookmarks(tag.index)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
timeagoInstance.cancel();
|
timeagoInstance.cancel();
|
||||||
timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');
|
timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
||||||
bookmark.last_click = $filter("date")(new Date(), "yyyy-MM-dd HH:mm:ss");
|
bookmark.last_click = $filter("date")(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
$scope.changeOrder($scope.order.indexOf(true));
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
timeagoInstance.cancel();
|
timeagoInstance.cancel();
|
||||||
timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');
|
timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue