完成分类页面编辑之后的书签加动画提示
This commit is contained in:
parent
cad9a57f8b
commit
a0bf765f82
|
|
@ -354,7 +354,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
|||
toastr.error('该分类【' + tag + '】已存在!', "提示");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (tag) {
|
||||
ngDialog.close(dialog);
|
||||
|
||||
|
|
@ -497,10 +497,17 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
|||
bookmark.tags = data.tags;
|
||||
bookmark.description = data.description;
|
||||
find = true;
|
||||
if ($scope.order[bookmark.type - 1]) {
|
||||
dataService.transition('#' + bookmark.id);
|
||||
}
|
||||
}
|
||||
})
|
||||
if (!find) {
|
||||
getTags({});
|
||||
if (data.tags.map((tag) => tag.id).indexOf($scope.currentTagId) >= 0) {
|
||||
if (!$scope.editMode) {
|
||||
$scope.getBookmarks($scope.currentTagId, $scope.currentPage = 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -540,12 +547,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
|||
}
|
||||
|
||||
function transition() {
|
||||
var className = 'js-tags-table';
|
||||
$('.' + className).transition('hide');
|
||||
$('.' + className).transition({
|
||||
animation: dataService.animation(),
|
||||
duration: 500,
|
||||
});
|
||||
dataService.transition($scope.showMode == 'item' ? '.js-tag-costomTag' : '.js-tags-table');
|
||||
}
|
||||
|
||||
function clickCmp(a, b) {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,31 @@ app.factory('dataService', [function() {
|
|||
var t = data[parseInt(Math.random() * 1000) % data.length];
|
||||
return t;
|
||||
},
|
||||
transition: function(selector, params) {
|
||||
var data = {};
|
||||
data.animation = (params && params.animation) ? params.animation : service.animation();
|
||||
data.duration = (params && params.duration) ? params.duration : 1000;
|
||||
data.onComplete = function() {
|
||||
if (params) {
|
||||
if (params.state == 'hide') {
|
||||
$(selector).hide();
|
||||
} else if (params.state == 'show') {
|
||||
$(selector).show();
|
||||
} else if (params.state == 'remove') {
|
||||
$(selector).remove();
|
||||
} else {
|
||||
$(selector).show();
|
||||
}
|
||||
params.cb && params.cb(); // 完成之后回调!
|
||||
} else {
|
||||
$(selector).show();
|
||||
}
|
||||
|
||||
}
|
||||
$(selector).transition('hide'); // 不管怎样,先隐藏
|
||||
console.log(data);
|
||||
$(selector).transition(data); //这个执行完之后一定是show
|
||||
},
|
||||
historyTypes: ['书签', '谷歌', 'Github', '栈溢出', '百度', '备忘录'],
|
||||
showStyles: ['navigate', 'costomTag', 'card', 'table'],
|
||||
forbidQuickKey: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="ui segment js-tags">
|
||||
<div class="ui container" ng-show="!editMode">
|
||||
<div class="ui container" ng-show="!editMode" style="cursor:default;">
|
||||
<div class="ui grid">
|
||||
<div class="two wide column js-tag-label" ng-if="tag.cnt" ng-repeat="tag in tags">
|
||||
<div class="ui small label" ng-class="{green:tag.bookmarkClicked}" ng-click="getBookmarks(tag.id, 1)">
|
||||
|
|
|
|||
Loading…
Reference in New Issue