diff --git a/app/scripts/controllers/new.js b/app/scripts/controllers/new.js index 3aaa354..745b362 100644 --- a/app/scripts/controllers/new.js +++ b/app/scripts/controllers/new.js @@ -18,11 +18,19 @@ return aria2SettingService.getSpecifiedOptions(keys); })(); + $scope.changeTab = function (tabName) { + if (tabName == 'options') { + $scope.loadDefaultOption(); + } + + $scope.context.currentTab = tabName; + }; + $rootScope.swipeActions.extentLeftSwipe = function () { var tabIndex = tabOrders.indexOf($scope.context.currentTab); if (tabIndex < tabOrders.length - 1) { - $scope.context.currentTab = tabOrders[tabIndex + 1]; + $scope.changeTab(tabOrders[tabIndex + 1]); return true; } else { return false; @@ -33,7 +41,7 @@ var tabIndex = tabOrders.indexOf($scope.context.currentTab); if (tabIndex > 0) { - $scope.context.currentTab = tabOrders[tabIndex - 1]; + $scope.changeTab(tabOrders[tabIndex - 1]); return true; } else { return false; diff --git a/app/scripts/controllers/task-detail.js b/app/scripts/controllers/task-detail.js index 7fa9a1b..74cc1d9 100644 --- a/app/scripts/controllers/task-detail.js +++ b/app/scripts/controllers/task-detail.js @@ -81,11 +81,19 @@ availableOptions: [] }; + $scope.changeTab = function (tabName) { + if (tabName == 'settings') { + $scope.loadTaskOption($scope.task); + } + + $scope.context.currentTab = tabName; + }; + $rootScope.swipeActions.extentLeftSwipe = function () { var tabIndex = tabOrders.indexOf($scope.context.currentTab); if (tabIndex < tabOrders.length - 1) { - $scope.context.currentTab = tabOrders[tabIndex + 1]; + $scope.changeTab(tabOrders[tabIndex + 1]); return true; } else { return false; @@ -96,7 +104,7 @@ var tabIndex = tabOrders.indexOf($scope.context.currentTab); if (tabIndex > 0) { - $scope.context.currentTab = tabOrders[tabIndex - 1]; + $scope.changeTab(tabOrders[tabIndex - 1]); return true; } else { return false; diff --git a/app/views/new.html b/app/views/new.html index 984b878..c3d3f15 100644 --- a/app/views/new.html +++ b/app/views/new.html @@ -2,10 +2,10 @@