加载设置的时候不显示设置

This commit is contained in:
luchenqun 2017-03-22 09:43:55 +08:00
parent e761d962b1
commit 62047e0573
2 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,7 @@ app.controller('settingsCtr', ['$scope', '$stateParams', '$filter', '$state', '$
$scope.user = {};
$scope.tagCnt = 0;
$scope.bookmarkCnt = 0;
$scope.loadShowStyle = false;
$scope.form[($stateParams && $stateParams.formIndex) || 0] = true;
$scope.changeForm = function(index) {
@ -15,15 +16,18 @@ app.controller('settingsCtr', ['$scope', '$stateParams', '$filter', '$state', '$
$scope.form[index] = true;
if (index <= 1) {
$scope.loadShowStyle = true;
bookmarkService.userInfo({})
.then((data) => {
$scope.user = data;
if (index == 0) {
updateShowStyle($scope.user && $scope.user.show_style);
updateShowStyle(($scope.user && $scope.user.show_style) || 'navigate');
$scope.loadShowStyle = false;
}
})
.catch((err) => {
toastr.error('获取信息失败。错误信息:' + JSON.stringify(err), "错误");
$scope.loadShowStyle = false;
});
if (index == 1) {
bookmarkService.getTags({})

View File

@ -33,7 +33,7 @@
<h4 class="ui horizontal divider header">
书签默认显示方式配置
</h4>
<div class="inline fields js-default-show-style">
<div class="inline fields js-default-show-style" ng-show="!loadShowStyle">
<div class="field" ng-click="updateDefaultShowStyle('navigate')">
<div class="ui radio checkbox js-radio-default-navigate">
<input type="radio" name="default-show-style" checked="checked">