Fixes persistence's mock, adds back the original keycode detection

This commit is contained in:
Hyzual 2015-02-08 22:39:27 +01:00
parent 5a7a06d1a2
commit 06329bef70
2 changed files with 5 additions and 4 deletions

View file

@ -175,9 +175,9 @@ angular.module('JamStash')
$(this).fadeOut(function () { $(this).remove(); });
return false;
})
// $document.keydown(function (e) {
// $scope.scrollToIndex(e);
// });
$document.keydown(function (e) {
$scope.scrollToIndex(e);
});
$scope.scrollToIndex = function (e) {
var source = e.target.id;
if (e.target.tagName.toUpperCase() != 'INPUT') {

View file

@ -5,6 +5,7 @@ describe("Main controller", function() {
beforeEach(function() {
mockGlobals = {
settings: {
SaveTrackPosition: false,
ShowQueue: false,
Debug: true,
Jukebox: false
@ -21,7 +22,7 @@ describe("Main controller", function() {
player.volume = 1.0;
// Mock the persistence service
persistence = jasmine.createSpyObj("persistence", ["getVolume", "saveVolume"]);
persistence = jasmine.createSpyObj("persistence", ["loadQueue", "loadTrackPosition", "getVolume", "saveVolume"]);
inject(function (_$controller_, $rootScope, _$document_, _$window_, _$location_, _$cookieStore_, _utils_, globals, _model_, _notifications_, _Page_) {
scope = $rootScope.$new();