Fixed task push text and move ctrlPressed logic to rootScope.

This commit is contained in:
Keith Holliday
2015-11-28 12:06:34 -06:00
parent 274f4ab4d2
commit 0dcba276a6
4 changed files with 19 additions and 19 deletions

View File

@@ -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;
}
});
}
]);