添加分类定制的快捷键
This commit is contained in:
parent
715b67fdfe
commit
ec1da85efd
|
|
@ -46,6 +46,7 @@ app.config(function($stateProvider, $urlRouterProvider, $httpProvider) {
|
||||||
templateUrl: '/views/tags.html',
|
templateUrl: '/views/tags.html',
|
||||||
params: {
|
params: {
|
||||||
tagId: null,
|
tagId: null,
|
||||||
|
orderIndex: null,
|
||||||
},
|
},
|
||||||
controller: 'tagsCtr'
|
controller: 'tagsCtr'
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -225,14 +225,22 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
||||||
if (key == 'A') {
|
if (key == 'A') {
|
||||||
if ($scope.selectLoginIndex !== dataService.LoginIndexNote) {
|
if ($scope.selectLoginIndex !== dataService.LoginIndexNote) {
|
||||||
updateMenuActive($scope.selectLoginIndex = dataService.LoginIndexNote);
|
updateMenuActive($scope.selectLoginIndex = dataService.LoginIndexNote);
|
||||||
$state.go('note', {
|
$state.go('note', { key: key }, { reload: true })
|
||||||
key: key,
|
|
||||||
}, {
|
|
||||||
reload: true,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key == ',' || key == '.' || key == '/') {
|
||||||
|
pubSubService.publish('Common.menuActive', {
|
||||||
|
login: $scope.login,
|
||||||
|
index: dataService.LoginIndexTags
|
||||||
|
});
|
||||||
|
var stateParams = {
|
||||||
|
tagId: -1,
|
||||||
|
orderIndex: (key == ',' ? 0 : (key == '.' ? 1 : 2)),
|
||||||
|
}
|
||||||
|
$state.go(dataService.loginMenus[dataService.LoginIndexTags].uiSref, stateParams, { reload: true, })
|
||||||
|
}
|
||||||
|
|
||||||
// 数字键用来切换菜单
|
// 数字键用来切换菜单
|
||||||
if (!isNaN(key)) {
|
if (!isNaN(key)) {
|
||||||
var num = parseInt(key);
|
var num = parseInt(key);
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.getBookmarks = function(tagId, currentPage) {
|
$scope.getBookmarks = function(tagId, currentPage) {
|
||||||
|
console.log(tagId, currentPage)
|
||||||
$scope.bookmarkClicked = true;
|
$scope.bookmarkClicked = true;
|
||||||
$scope.currentTagId = tagId;
|
$scope.currentTagId = tagId;
|
||||||
$scope.currentPage = currentPage;
|
$scope.currentPage = currentPage;
|
||||||
|
|
@ -473,7 +474,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
||||||
find = true; // 如果是删了分类返回来,那么要重新默认选中第一个分类
|
find = true; // 如果是删了分类返回来,那么要重新默认选中第一个分类
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (!find) $scope.currentTagId = null;
|
if (!find && $scope.currentTagId !== -1) $scope.currentTagId = null;
|
||||||
if (!$scope.currentTagId && $scope.tags.length > 0) {
|
if (!$scope.currentTagId && $scope.tags.length > 0) {
|
||||||
$scope.currentTagId = $scope.tags[0].id;
|
$scope.currentTagId = $scope.tags[0].id;
|
||||||
$scope.tags[0].bookmarkClicked = true;
|
$scope.tags[0].bookmarkClicked = true;
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,9 @@ app.factory('dataService', [function() {
|
||||||
'R': '在热门收藏界面,已用作随机查看热门收藏',
|
'R': '在热门收藏界面,已用作随机查看热门收藏',
|
||||||
'INSERT': '全局页面,已用做添加书签',
|
'INSERT': '全局页面,已用做添加书签',
|
||||||
'ESC': '全局页面,已用做退出弹窗',
|
'ESC': '全局页面,已用做退出弹窗',
|
||||||
|
',': '跳转到分类定制点击次数',
|
||||||
|
'.': '跳转到分类定制添加日期',
|
||||||
|
'/': '跳转到分类定制最后点击',
|
||||||
},
|
},
|
||||||
keyShortcuts: function() { // 判断快捷方式是否生效
|
keyShortcuts: function() { // 判断快捷方式是否生效
|
||||||
var ret = true;
|
var ret = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue