From 16688c4ec1767f647987d4ae8ec03955eb3b89c8 Mon Sep 17 00:00:00 2001 From: luchenqun Date: Mon, 6 Feb 2017 12:05:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=98=AF=E5=90=A6=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E4=B9=A6=E7=AD=BE=E5=AD=98=E5=85=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/scripts/controllers/edit-controller.js | 5 ++++- public/views/edit.html | 2 +- public/views/menus.html | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/scripts/controllers/edit-controller.js b/public/scripts/controllers/edit-controller.js index d368823..5452a14 100644 --- a/public/scripts/controllers/edit-controller.js +++ b/public/scripts/controllers/edit-controller.js @@ -83,7 +83,7 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', 'bookmarkService', 'p id: $scope.id, url: $scope.url, title: $scope.title, - public: '1', + public: $('.ui.checkbox.js-public').checkbox('is checked') ? '1' : '0', tags: selectedTags, description: $scope.description } @@ -111,6 +111,7 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', 'bookmarkService', 'p }).modal('show'); $('.ui.modal.js-add-bookmark .ui.dropdown').dropdown('clear'); $('.ui.modal.js-add-bookmark .ui.dropdown').addClass('loading'); + $('.ui.checkbox.js-public').checkbox('set checked'); init(); getTags({}); }); @@ -134,6 +135,8 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', 'bookmarkService', 'p $scope.description = (bookmark && bookmark.description) || ''; $scope.tags = data.tags; $scope.public = (bookmark && bookmark.id) || '1'; + $('.ui.checkbox.js-public').checkbox((bookmark && bookmark.public && bookmark.public == '1') ? 'set checked' : 'set unchecked') + $timeout(function() { data.bookmarkTags.forEach((tagId) => { diff --git a/public/views/edit.html b/public/views/edit.html index 6aa1032..e90eeb8 100644 --- a/public/views/edit.html +++ b/public/views/edit.html @@ -35,7 +35,7 @@
-
+
diff --git a/public/views/menus.html b/public/views/menus.html index ed2c6ae..72be7b1 100644 --- a/public/views/menus.html +++ b/public/views/menus.html @@ -1,6 +1,6 @@