From 9d7770b282b2bc4c325ce9640cc8d0086cb17456 Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Wed, 29 Jun 2011 04:02:42 +0400 Subject: [PATCH] Playlist remove button fixes --- app/coffeescripts/player.coffee | 8 +++----- public/javascripts/coffee/player.js | 9 ++++----- public/stylesheets/_sass/player.scss | 2 +- public/stylesheets/player.css | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/app/coffeescripts/player.coffee b/app/coffeescripts/player.coffee index a614e38..1b6d4af 100644 --- a/app/coffeescripts/player.coffee +++ b/app/coffeescripts/player.coffee @@ -66,11 +66,9 @@ class Player ' - $('.playlist').html($('.playlist-tracks')).scrollbar + $('.playlist').html($('.playlist-tracks')).scrollbar() $('.playlist-tracks').sortable axis: 'y', handle: '.dragbox' - console.log _player.hasTrack() - console.log initial_count if autoplay _player.setTrack($('.playlist-tracks li').last().attr('id').split('i')[1]) else if initial_count == 0 and not _player.hasTrack() @@ -203,8 +201,8 @@ $('#empty-playlist').live 'click', -> # Playlist Actions -$('.playlist-tracks li .fade, .playlist-tracks li .duration, .playlist-tracks li .remove').live 'mouseover mouseout', (e) -> - if e.type == 'mouseover' +$('.playlist-tracks li .fade, .playlist-tracks li .duration, .playlist-tracks li .remove').live 'mousemove mouseover mouseout', (e) -> + if e.type in ['mouseover', 'mousemove'] and ($(window).width() - e.clientX) < 60 $(this).parent().find('.duration').hide() $(this).parent().find('.remove').show() else diff --git a/public/javascripts/coffee/player.js b/public/javascripts/coffee/player.js index e728f5d..045e377 100644 --- a/public/javascripts/coffee/player.js +++ b/public/javascripts/coffee/player.js @@ -75,13 +75,11 @@ Player = (function() { \ '); } - $('.playlist').html($('.playlist-tracks')).scrollbar; + $('.playlist').html($('.playlist-tracks')).scrollbar(); $('.playlist-tracks').sortable({ axis: 'y', handle: '.dragbox' }); - console.log(_player.hasTrack()); - console.log(initial_count); if (autoplay) { _player.setTrack($('.playlist-tracks li').last().attr('id').split('i')[1]); } else if (initial_count === 0 && !_player.hasTrack()) { @@ -241,8 +239,9 @@ $('#empty-playlist').live('click', function() { } return false; }); -$('.playlist-tracks li .fade, .playlist-tracks li .duration, .playlist-tracks li .remove').live('mouseover mouseout', function(e) { - if (e.type === 'mouseover') { +$('.playlist-tracks li .fade, .playlist-tracks li .duration, .playlist-tracks li .remove').live('mousemove mouseover mouseout', function(e) { + var _ref; + if (((_ref = e.type) === 'mouseover' || _ref === 'mousemove') && ($(window).width() - e.clientX) < 60) { $(this).parent().find('.duration').hide(); $(this).parent().find('.remove').show(); } else { diff --git a/public/stylesheets/_sass/player.scss b/public/stylesheets/_sass/player.scss index af3c741..fb76aab 100644 --- a/public/stylesheets/_sass/player.scss +++ b/public/stylesheets/_sass/player.scss @@ -157,7 +157,7 @@ $icons_dir: "/images/icns/"; top: 0; right: 0; z-index: 20; - width: 100px; + width: 80px; height: 26px; @include alpha_gradient(32, 32, 32, '202020'); } diff --git a/public/stylesheets/player.css b/public/stylesheets/player.css index 7d59abe..019047b 100644 --- a/public/stylesheets/player.css +++ b/public/stylesheets/player.css @@ -124,7 +124,7 @@ top: 0; right: 0; z-index: 20; - width: 100px; + width: 80px; height: 26px; background: -moz-linear-gradient(left, rgba(32, 32, 32, 0) 0%, #202020 50%, #202020 100%); background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(32, 32, 32, 0)), color-stop(50%, #202020), color-stop(100%, #202020));