added default library layout setting

so you can decide if you show list or grid by default
This commit is contained in:
Alex Norman 2013-12-03 10:53:41 -08:00
parent eebdb25a39
commit fc231e1c0b
4 changed files with 15 additions and 3 deletions

View file

@ -131,6 +131,7 @@ JamStash.service('globals', function (utils) {
SaveTrackPosition: false, SaveTrackPosition: false,
ForceFlash: false, ForceFlash: false,
Theme: "Default", Theme: "Default",
DefaultLibraryLayout: "grid",
AutoPlay: false, AutoPlay: false,
LoopQueue: false, LoopQueue: false,
Repeat: false, Repeat: false,
@ -247,4 +248,4 @@ JamStash.service('notifications', function ($rootScope, globals) {
notifications[notification].cancel(); notifications[notification].cancel();
} }
} }
}); });

View file

@ -32,7 +32,8 @@ function SubsonicCtrl($scope, $rootScope, $location, $window, $routeParams, util
$scope.sortSubsonicAlbums(newValue); $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 = [ $scope.Layouts = [
{ id: "list", name: "List" }, { id: "list", name: "List" },
{ id: "grid", name: "Grid" }, { id: "grid", name: "Grid" },

View file

@ -13,6 +13,11 @@ function SettingsCtrl($scope, $routeParams, $location, utils, globals, json, not
]; ];
$scope.Protocols = ["json", "jsonp"]; $scope.Protocols = ["json", "jsonp"];
$scope.Themes = ["Default", "Dark"]; $scope.Themes = ["Default", "Dark"];
$scope.LibraryLayouts = [
{ id: "list", name: "List" },
{ id: "grid", name: "Grid" },
];
$scope.DefaultLibraryLayout = 'grid';
$scope.$watch('settings.HideAZ', function () { $scope.$watch('settings.HideAZ', function () {
if (globals.settings.HideAZ) { if (globals.settings.HideAZ) {
$('#AZIndex').hide(); $('#AZIndex').hide();
@ -73,4 +78,4 @@ function SettingsCtrl($scope, $routeParams, $location, utils, globals, json, not
/* Load on Startup */ /* Load on Startup */
/* End Startup */ /* End Startup */
}); });

View file

@ -41,6 +41,11 @@
<div class="clear"></div> <div class="clear"></div>
<div class="inputwrap"><input type="checkbox" id="ScrollTitle" name="ScrollTitle" value="1" title="Scroll the Title Once" ng-model="settings.ScrollTitle"/></div> <div class="inputwrap"><input type="checkbox" id="ScrollTitle" name="ScrollTitle" value="1" title="Scroll the Title Once" ng-model="settings.ScrollTitle"/></div>
<label for="ScrollTitle">Scroll Title</label> <label for="ScrollTitle">Scroll Title</label>
<div class="clear"></div>
<label for="DefaultLibraryLayout">Default Library Layout</label>
<div class="clear"></div>
<select id="DefaultLibraryLayout" name="DefaultLibraryLayout" class="" ng-model="settings.DefaultLibraryLayout" ng-options="o.id as o.name for o in LibraryLayouts" title="AJAX Request Library Layout"></select>
<div class="clear"></div>
</fieldset> </fieldset>
<div class="clear"></div> <div class="clear"></div>
<fieldset id="HTML5"> <fieldset id="HTML5">