From 5842c0615a2227cd42b368130bf12c40e1034f6f Mon Sep 17 00:00:00 2001 From: Carey Metcalfe Date: Mon, 16 Oct 2017 01:23:08 -0400 Subject: [PATCH] Fix Subsonic tab toggling behaviour Previously clicking on an already-selected tab would hide its contents. --- app/subsonic/subsonic.js | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/app/subsonic/subsonic.js b/app/subsonic/subsonic.js index 3bf8ecd..86c047a 100644 --- a/app/subsonic/subsonic.js +++ b/app/subsonic/subsonic.js @@ -129,35 +129,23 @@ angular.module('jamstash.subsonic.controller', [ $rootScope.showIndex = false; $scope.toggleIndex = function () { - if ($rootScope.showIndex) { - $rootScope.showIndex = false; - } else { - $rootScope.showIndex = true; - $scope.showPlaylist = false; - $scope.showPodcast = false; - } + $rootScope.showIndex = true; + $scope.showPlaylist = false; + $scope.showPodcast = false; $scope.saveDefaultSection('index'); }; $scope.showPlaylist = false; $scope.togglePlaylist = function () { - if ($scope.showPlaylist) { - $scope.showPlaylist = false; - } else { - $scope.showPlaylist = true; - $rootScope.showIndex = false; - $scope.showPodcast = false; - } + $rootScope.showIndex = false; + $scope.showPlaylist = true; + $scope.showPodcast = false; $scope.saveDefaultSection('playlist'); }; $scope.showPodcast = false; $scope.togglePodcast = function () { - if ($scope.showPodcast) { - $scope.showPodcast = false; - } else { - $scope.showPodcast = true; - $scope.showPlaylist = false; - $rootScope.showIndex = false; - } + $rootScope.showIndex = false; + $scope.showPlaylist = false; + $scope.showPodcast = true; $scope.saveDefaultSection('podcast'); }; $scope.saveDefaultSection = function (val) {