Added ability to invert pushToBottom when holding down ctrl or cmd button

This commit is contained in:
Keith Holliday
2015-11-22 15:57:14 -06:00
parent 9a76e7a62c
commit b668829d85
5 changed files with 23 additions and 5 deletions

View File

@@ -89,7 +89,7 @@
"sureDelete": "Are you sure you want to delete this task?",
"streakCoins": "Streak Bonus!",
"pushTaskToTop": "Push task to top",
"pushTaskToBottom": "Push task to bottom",
"pushTaskToBottom": "Push task to bottom. Hold ctrl or cmd to push to top.",
"emptyTask": "Enter the task's title first.",
"dailiesRestingInInn": "You're Resting in the Inn! Your Dailies will NOT hurt you tonight, but they WILL still refresh every day. If you're in a quest, you won't deal damage/collect items until you check out of the Inn, but you can still be injured by a Boss if your Party mates skip their own Dailies.",
"habitHelp1": "Good Habits are things that you do often. They award Gold and Experience every time you click the <%= plusIcon %>.",

View File

@@ -394,6 +394,11 @@ for $stage in $stages
a.badge
position: relative; top:-2px
a.push-down span
-ms-transform: rotate(180deg); /* IE 9 */
-webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
transform: rotate(180deg);
.task:hover .task-meta-controls
opacity: 1

View File

@@ -76,10 +76,23 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
* Pushes task to top or bottom of list
*/
$scope.pushTask = function(task, index, location) {
var to = (location === 'bottom') ? -1 : 0;
var to = (location === 'bottom' || $scope.pushLocation === 'bottom') ? -1 : 0;
User.user.ops.sortTask({params:{id:task.id},query:{from:index, to:to}})
};
var ctrlKeys = [17, 224, 91];
$scope.$on("habit:keydown", function (e, keyEvent) {
if (ctrlKeys.indexOf(keyEvent.keyCode) !== -1) {
$scope.pushLocation = "bottom";
}
});
$scope.$on("habit:keyup", function (e, keyEvent) {
if (ctrlKeys.indexOf(keyEvent.keyCode) !== -1) {
$scope.pushLocation = "top";
}
});
/**
* This is calculated post-change, so task.completed=true if they just checked it
*/

View File

@@ -1,6 +1,6 @@
doctype html
//html(ng-app="habitrpg", ng-controller="RootCtrl", ng-class='{"applying-action":applyingAction}', ui-keypress="{27:'castCancel()'}")
html(ng-app="habitrpg", ng-controller="RootCtrl", ng-class='{"applying-action":applyingAction}', ui-keyup="{27:'castCancel()'}", ng-keydown="$broadcast('habit:keyup', $event)")
html(ng-app="habitrpg", ng-controller="RootCtrl", ng-class='{"applying-action":applyingAction}', ui-keyup="{27:'castCancel()'}", ng-keydown="$broadcast('habit:keydown', $event)", ng-keyup="$broadcast('habit:keyup', $event)")
head
title=env.t('titleIndex')
// ?v=1 needed to force refresh

View File

@@ -13,7 +13,7 @@
// Icons only available if you own the tasks (aka, hidden from challenge stats)
span(ng-if='!obj._locked')
a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop'))
a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop'), ng-class="{'push-down': pushLocation == 'bottom'}")
span.glyphicon.glyphicon-open
// a(ng-click='pushTask(task,$index,"bottom")', tooltip=env.t('pushTaskToBottom'))
// span.glyphicon.glyphicon-import