diff --git a/js/app.js b/js/app.js index 1162fdd..c945164 100755 --- a/js/app.js +++ b/js/app.js @@ -131,6 +131,7 @@ JamStash.service('globals', function (utils) { SaveTrackPosition: false, ForceFlash: false, Theme: "Default", + DefaultLibraryLayout: "grid", AutoPlay: false, LoopQueue: false, Repeat: false, @@ -247,4 +248,4 @@ JamStash.service('notifications', function ($rootScope, globals) { notifications[notification].cancel(); } } -}); \ No newline at end of file +}); diff --git a/js/controllers/library.js b/js/controllers/library.js index 4e42114..59b4b3d 100644 --- a/js/controllers/library.js +++ b/js/controllers/library.js @@ -32,7 +32,8 @@ function SubsonicCtrl($scope, $rootScope, $location, $window, $routeParams, util $scope.sortSubsonicAlbums(newValue); } }); - $scope.selectedLayout = 'grid'; + $scope.selectedLayout = globals.settings.DefaultLibraryLayout; + //not sure how to just grab the layouts hash from the settings controller $scope.Layouts = [ { id: "list", name: "List" }, { id: "grid", name: "Grid" }, diff --git a/js/controllers/settings.js b/js/controllers/settings.js index 8e1d046..2f7f184 100644 --- a/js/controllers/settings.js +++ b/js/controllers/settings.js @@ -13,6 +13,11 @@ function SettingsCtrl($scope, $routeParams, $location, utils, globals, json, not ]; $scope.Protocols = ["json", "jsonp"]; $scope.Themes = ["Default", "Dark"]; + $scope.LibraryLayouts = [ + { id: "list", name: "List" }, + { id: "grid", name: "Grid" }, + ]; + $scope.DefaultLibraryLayout = 'grid'; $scope.$watch('settings.HideAZ', function () { if (globals.settings.HideAZ) { $('#AZIndex').hide(); @@ -73,4 +78,4 @@ function SettingsCtrl($scope, $routeParams, $location, utils, globals, json, not /* Load on Startup */ /* End Startup */ -}); \ No newline at end of file +}); diff --git a/js/partials/settingsForm.html b/js/partials/settingsForm.html index e49bf20..585184b 100644 --- a/js/partials/settingsForm.html +++ b/js/partials/settingsForm.html @@ -41,6 +41,11 @@
+ + + + +