add option for swipe gesture

This commit is contained in:
MaysWind 2021-02-14 14:10:14 +08:00
parent 05e0fb6b4f
commit 999b43c3ee
8 changed files with 33 additions and 0 deletions

View file

@ -175,6 +175,7 @@ Add New RPC Setting=添加新 RPC 设置
Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要删除 RPC 设置 "{{rpcName}}"? Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要删除 RPC 设置 "{{rpcName}}"?
Updating Global Stat Interval=全局状态更新间隔 Updating Global Stat Interval=全局状态更新间隔
Updating Task Information Interval=任务信息更新间隔 Updating Task Information Interval=任务信息更新间隔
Swipe Gesture=滑动手势
Change Tasks Order by Drag-and-drop=拖拽任务排序 Change Tasks Order by Drag-and-drop=拖拽任务排序
Action After Creating New Tasks=创建新任务后执行操作 Action After Creating New Tasks=创建新任务后执行操作
Navigate to Task List Page=转到任务列表页面 Navigate to Task List Page=转到任务列表页面

View file

@ -175,6 +175,7 @@ Add New RPC Setting=加入新 RPC 設定
Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要刪除 RPC 設定 "{{rpcName}}"? Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要刪除 RPC 設定 "{{rpcName}}"?
Updating Global Stat Interval=全域狀態更新間隔 Updating Global Stat Interval=全域狀態更新間隔
Updating Task Information Interval=工作資訊更新間隔 Updating Task Information Interval=工作資訊更新間隔
Swipe Gesture=滑動手勢
Change Tasks Order by Drag-and-drop=拖拽工作排序 Change Tasks Order by Drag-and-drop=拖拽工作排序
Action After Creating New Tasks=建立新工作後執行操作 Action After Creating New Tasks=建立新工作後執行操作
Navigate to Task List Page=轉到工作清單頁面 Navigate to Task List Page=轉到工作清單頁面

View file

@ -37,6 +37,7 @@
extendRpcServers: [], extendRpcServers: [],
globalStatRefreshInterval: 1000, globalStatRefreshInterval: 1000,
downloadTaskRefreshInterval: 1000, downloadTaskRefreshInterval: 1000,
swipeGesture: true,
dragAndDropTasks: true, dragAndDropTasks: true,
rpcListDisplayOrder: 'recentlyUsed', rpcListDisplayOrder: 'recentlyUsed',
afterCreatingNewTask: 'task-list', afterCreatingNewTask: 'task-list',

View file

@ -179,6 +179,7 @@
'Are you sure you want to remove rpc setting "{{rpcName}}"?': 'Are you sure you want to remove rpc setting "{{rpcName}}"?', 'Are you sure you want to remove rpc setting "{{rpcName}}"?': 'Are you sure you want to remove rpc setting "{{rpcName}}"?',
'Updating Global Stat Interval': 'Updating Global Stat Interval', 'Updating Global Stat Interval': 'Updating Global Stat Interval',
'Updating Task Information Interval': 'Updating Task Information Interval', 'Updating Task Information Interval': 'Updating Task Information Interval',
'Swipe Gesture': 'Swipe Gesture',
'Change Tasks Order by Drag-and-drop': 'Change Tasks Order by Drag-and-drop', 'Change Tasks Order by Drag-and-drop': 'Change Tasks Order by Drag-and-drop',
'Action After Creating New Tasks': 'Action After Creating New Tasks', 'Action After Creating New Tasks': 'Action After Creating New Tasks',
'Navigate to Task List Page': 'Navigate to Task List Page', 'Navigate to Task List Page': 'Navigate to Task List Page',

View file

@ -185,6 +185,10 @@
ariaNgSettingService.setRPCListDisplayOrder(value); ariaNgSettingService.setRPCListDisplayOrder(value);
}; };
$scope.setSwipeGesture = function (value) {
ariaNgSettingService.setSwipeGesture(value);
};
$scope.setDragAndDropTasks = function (value) { $scope.setDragAndDropTasks = function (value) {
ariaNgSettingService.setDragAndDropTasks(value); ariaNgSettingService.setDragAndDropTasks(value);
}; };

View file

@ -345,6 +345,10 @@
$rootScope.swipeActions = { $rootScope.swipeActions = {
leftSwipe: function () { leftSwipe: function () {
if (!ariaNgSettingService.getSwipeGesture()) {
return;
}
if (isSidebarShowInSmallScreen()) { if (isSidebarShowInSmallScreen()) {
hideSidebar(); hideSidebar();
return; return;
@ -356,6 +360,10 @@
} }
}, },
rightSwipe: function () { rightSwipe: function () {
if (!ariaNgSettingService.getSwipeGesture()) {
return;
}
if (!this.extendRightSwipe || if (!this.extendRightSwipe ||
(angular.isFunction(this.extendRightSwipe) && !this.extendRightSwipe())) { (angular.isFunction(this.extendRightSwipe) && !this.extendRightSwipe())) {
showSidebar(); showSidebar();

View file

@ -395,6 +395,12 @@
setDownloadTaskRefreshInterval: function (value) { setDownloadTaskRefreshInterval: function (value) {
setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0)); setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0));
}, },
getSwipeGesture: function () {
return getOption('swipeGesture');
},
setSwipeGesture: function (value) {
setOption('swipeGesture', value);
},
getDragAndDropTasks: function () { getDragAndDropTasks: function () {
return getOption('dragAndDropTasks'); return getOption('dragAndDropTasks');
}, },

View file

@ -135,6 +135,17 @@
</select> </select>
</div> </div>
</div> </div>
<div class="row">
<div class="setting-key setting-key-without-desc col-sm-4">
<span translate>Swipe Gesture</span>
</div>
<div class="setting-value col-sm-8">
<select class="form-control" style="width: 100%;" ng-model="context.settings.swipeGesture"
ng-change="setSwipeGesture(context.settings.swipeGesture)"
ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions">
</select>
</div>
</div>
<div class="row"> <div class="row">
<div class="setting-key setting-key-without-desc col-sm-4"> <div class="setting-key setting-key-without-desc col-sm-4">
<span translate>Change Tasks Order by Drag-and-drop</span> <span translate>Change Tasks Order by Drag-and-drop</span>