diff --git a/app/assets/javascripts/ajax.coffee b/app/assets/javascripts/ajax.coffee index 905be2b..587cafb 100644 --- a/app/assets/javascripts/ajax.coffee +++ b/app/assets/javascripts/ajax.coffee @@ -34,7 +34,7 @@ class window.Ajax detectPage: () -> if m = _ajax.getAnchor().match /\/artist\/(.+)\// _search.loadArtistData m[1] - else if _ajax.getAnchor() == '' + else if _ajax.getAnchor().match /\// _ajax.loadIndexPage(); else if _ajax.getAnchor().match /\/settings\// _settings.loadSettingsPage() diff --git a/app/assets/javascripts/page.coffee b/app/assets/javascripts/page.coffee index c1ee9bc..65bcc1b 100644 --- a/app/assets/javascripts/page.coffee +++ b/app/assets/javascripts/page.coffee @@ -29,6 +29,9 @@ class window.Page false $ -> + $('#logo').live 'click', -> + _ajax.go '/' + false $('.about').live 'click', -> _ajax.go '/about/' false diff --git a/app/assets/javascripts/search.coffee b/app/assets/javascripts/search.coffee index a1effa6..decbbc9 100644 --- a/app/assets/javascripts/search.coffee +++ b/app/assets/javascripts/search.coffee @@ -19,8 +19,10 @@ class window.Search if data.status in ['ok', 'loading'] _ajax.setArchor '/artist/' +name+ '/' _page.print data.html - for album in data.albums - _player.albums[album.id] = album + if _session.getUser().id + for album in data.albums + _player.albums[album.id] = album + $('.button-container').show() _search.hideSpinner() if data.status is 'loading' setTimeout () -> diff --git a/app/assets/javascripts/vkontakte.coffee b/app/assets/javascripts/vkontakte.coffee index 3fe62d4..f9f07fd 100644 --- a/app/assets/javascripts/vkontakte.coffee +++ b/app/assets/javascripts/vkontakte.coffee @@ -132,8 +132,8 @@ $('#login').live 'click', -> , 8 false $('#logout').live 'click', -> - _ajax.go '/search/'; VK.Auth.logout (response) -> _vkontakte.authInfo(response) + $('.button-container').hide() false false diff --git a/app/assets/stylesheets/albums.scss b/app/assets/stylesheets/albums.scss index ae85418..9805228 100644 --- a/app/assets/stylesheets/albums.scss +++ b/app/assets/stylesheets/albums.scss @@ -19,6 +19,7 @@ max-width: 220px; } .button-container { + display: none; text-align: center; margin-top: 10px; } diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 4df60a6..fca84a5 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -15,7 +15,7 @@ .topbar-inner .container %h3 - %a{ :href => "#/" } BeatHaven + %a#logo{ :href => "#/" } BeatHaven %ul.nav %li %a{ :href => "http://blog.beathaven.org/" }= I18n.t 'global.news'