From 87bc4a434a1b8853b64669fc890d49a5878479c5 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Tue, 15 Apr 2014 15:32:17 +0100 Subject: [PATCH] Can show and hide library. --- assets/javascripts/controllers/library.controller.js | 5 +++++ assets/javascripts/controllers/mpd-client.controller.js | 5 +++++ assets/javascripts/libs/angular-resource.js | 0 assets/javascripts/views/library.html | 4 ++-- assets/javascripts/views/queue.html | 6 +++--- views/index.erb | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 assets/javascripts/controllers/mpd-client.controller.js mode change 100755 => 100644 assets/javascripts/libs/angular-resource.js diff --git a/assets/javascripts/controllers/library.controller.js b/assets/javascripts/controllers/library.controller.js index a375296..11f50cd 100644 --- a/assets/javascripts/controllers/library.controller.js +++ b/assets/javascripts/controllers/library.controller.js @@ -1,2 +1,7 @@ mpdClient.controller('library', function ($scope, api) { + $scope.show = false + + $scope.$on('library:show', function () { $scope.show = true }) + + $scope.hide = function () { $scope.show = false } }) diff --git a/assets/javascripts/controllers/mpd-client.controller.js b/assets/javascripts/controllers/mpd-client.controller.js new file mode 100644 index 0000000..8fc4f3d --- /dev/null +++ b/assets/javascripts/controllers/mpd-client.controller.js @@ -0,0 +1,5 @@ +mpdClient.controller('mpd-client', function ($rootScope, $scope) { + $scope.showLibrary = function () { + $scope.$broadcast('library:show') + } +}) diff --git a/assets/javascripts/libs/angular-resource.js b/assets/javascripts/libs/angular-resource.js old mode 100755 new mode 100644 diff --git a/assets/javascripts/views/library.html b/assets/javascripts/views/library.html index c5e0411..c5bfdce 100644 --- a/assets/javascripts/views/library.html +++ b/assets/javascripts/views/library.html @@ -1,6 +1,6 @@ -
+
- Close + Close

Library

diff --git a/assets/javascripts/views/queue.html b/assets/javascripts/views/queue.html index 5ce6333..5956e90 100644 --- a/assets/javascripts/views/queue.html +++ b/assets/javascripts/views/queue.html @@ -1,9 +1,9 @@ -
+
- Library + Library

Queue

-
    +
    1. {{ song.title }}

      {{ song.artist }}

      diff --git a/views/index.erb b/views/index.erb index b62fac9..1ac656f 100644 --- a/views/index.erb +++ b/views/index.erb @@ -8,7 +8,7 @@ -
      +