From 1bcea9a6a70bbc88b7e4c40c375eece08b8d73fb Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Sun, 17 Aug 2014 23:42:50 +0100 Subject: [PATCH] Various fixer uppers --- static/css/dss.main.css | 7 ++++ .../apps/sidebar/views/sidebarLeftNav.coffee | 14 +++++++ static/js/dss/templates/nowplaying.jst | 41 +++++++------------ static/js/dss/templates/sidebarleftnav.jst | 2 + 4 files changed, 38 insertions(+), 26 deletions(-) diff --git a/static/css/dss.main.css b/static/css/dss.main.css index 8b35b69..726a403 100644 --- a/static/css/dss.main.css +++ b/static/css/dss.main.css @@ -782,3 +782,10 @@ img.mix-listing-image { .btn-group a { cursor: pointer; } + +.truncate { + width: 250px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} \ No newline at end of file diff --git a/static/js/dss/apps/sidebar/views/sidebarLeftNav.coffee b/static/js/dss/apps/sidebar/views/sidebarLeftNav.coffee index c91a68c..6c2936b 100644 --- a/static/js/dss/apps/sidebar/views/sidebarLeftNav.coffee +++ b/static/js/dss/apps/sidebar/views/sidebarLeftNav.coffee @@ -2,6 +2,9 @@ class Views.SidebarLeftNav extends Marionette.LayoutView template: "sidebarleftnav" + regions: + nowPlayingRegion: '#sidebar-shortcuts-now-playing' + events: "click #button-mute": "muteAudio" "click #header-random-button": "showRandom" @@ -14,6 +17,10 @@ initialize: -> @listenTo App.vent, "mix:play", @trackPlaying @listenTo App.vent, "mix:pause", @trackPaused + @listenTo App.vent, 'mix:init', @mixInit + + onRender: -> + $('#sidebar-shortcuts-now-playing', @el).hide() muteAudio: -> if App.audioController.audioState is 0 @@ -36,5 +43,12 @@ donate: -> App.vent.trigger('app:donate') + mixInit: (model) -> + $(@nowPlayingRegion.el).show() + @nowPlayingRegion.show(new App.NowPlayingApp.Views.NowPlayingView({ + source: 'mix', + model: model + })) + Views.SidebarView diff --git a/static/js/dss/templates/nowplaying.jst b/static/js/dss/templates/nowplaying.jst index 862dffd..4099afa 100644 --- a/static/js/dss/templates/nowplaying.jst +++ b/static/js/dss/templates/nowplaying.jst @@ -1,30 +1,19 @@ -
-
- - Now Playing -
-
+
+
+ Alex Doe's avatar + <%= user_name %> -
-
- -
- - - - - - +
+ <%= title %>
+ +
diff --git a/static/js/dss/templates/sidebarleftnav.jst b/static/js/dss/templates/sidebarleftnav.jst index fb3f73c..d0dd531 100644 --- a/static/js/dss/templates/sidebarleftnav.jst +++ b/static/js/dss/templates/sidebarleftnav.jst @@ -30,6 +30,8 @@
<% } %> +