根据是否公开书签存入数据库

This commit is contained in:
luchenqun 2017-02-06 12:05:37 +08:00
parent 6157296461
commit 16688c4ec1
3 changed files with 6 additions and 3 deletions

View File

@ -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) => {

View File

@ -35,7 +35,7 @@
<textarea rows="2" placeholder="可以是网站的说明,也可以备忘一下账号密码什么的,就算公开你的链接,这个也只有自己能在详情里面看到" ng-model="description"></textarea>
</div>
<div class="field">
<div class="ui checkbox checked">
<div class="ui checkbox checked js-public">
<input type="checkbox" name="example" checked="">
<label>我要公开此收藏的链接供别人搜索</label>
</div>

View File

@ -1,6 +1,6 @@
<div class="js-menu" ng-controller="menuCtr">
<div class="ui huge menu js-login-in" ng-if="login">
<a class="item" ng-class="{selected:$index===selectLoginIndex}" ui-sref="{{ menu.uiSref }}" ui-sref-opts="{reload: true}" ng-repeat="menu in loginMenus">
<a class="item" ng-class="{selected:$index===selectLoginIndex}" ui-sref="{{ menu.uiSref }}" ui-sref-opts="{reload: true}" ng-repeat="menu in loginMenus" jsMenuInit>
<div>{{ menu.title }}</div>
<div class="ui floating simple dropdown icon js-bookmark-dropdown" ng-if="$index==0" ng-click="$event.stopPropagation();">
<i class="dropdown icon"></i>