From a7b8d9d31d3c0208983b4247c70ea527807c4606 Mon Sep 17 00:00:00 2001 From: luchenqun Date: Tue, 21 Mar 2017 17:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=82=B9=E5=87=BB=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=9C=A8=E8=A1=A8=E6=A0=BC=E9=87=8C=E9=9D=A2?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/controllers/bookmarks-controller.js | 16 +++++++++++++++- public/scripts/controllers/tags-controller.js | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/public/scripts/controllers/bookmarks-controller.js b/public/scripts/controllers/bookmarks-controller.js index 54f721a..92127ab 100644 --- a/public/scripts/controllers/bookmarks-controller.js +++ b/public/scripts/controllers/bookmarks-controller.js @@ -55,13 +55,27 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', ' }); 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) { bookmark.click_count += 1; 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() { timeagoInstance.cancel(); timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN'); diff --git a/public/scripts/controllers/tags-controller.js b/public/scripts/controllers/tags-controller.js index 20a3163..020aac8 100644 --- a/public/scripts/controllers/tags-controller.js +++ b/public/scripts/controllers/tags-controller.js @@ -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"); } }) + $scope.changeOrder($scope.order.indexOf(true)); $timeout(function() { timeagoInstance.cancel(); timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');