mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Fixed task push text and move ctrlPressed logic to rootScope.
This commit is contained in:
@@ -327,5 +327,19 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
});
|
||||
// error will be handled via $http interceptor
|
||||
}
|
||||
|
||||
// Global Keyevents
|
||||
var ctrlKeys = [17, 224, 91];
|
||||
$scope.$on("habit:keydown", function (e, keyEvent) {
|
||||
if (ctrlKeys.indexOf(keyEvent.keyCode) !== -1) {
|
||||
$scope.ctrlPressed = true;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on("habit:keyup", function (e, keyEvent) {
|
||||
if (ctrlKeys.indexOf(keyEvent.keyCode) !== -1) {
|
||||
$scope.ctrlPressed = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user