Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from avalonmediasystem/bugfix/marker-placement
Browse files Browse the repository at this point in the history
Fix marker placement on time rail
  • Loading branch information
cjcolvar authored Jun 1, 2017
2 parents e093eb9 + 54d8c36 commit fd9c084
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/me-add-to-playlist.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@
later_markers.first().before(new_marker)
else
$('#markers').append(new_marker)
offset_percent = if isNaN(parseFloat(offset)) then 0 else Math.min(1, offset / currentPlayer.media.duration)
offset = Math.round($('.mejs-time-total').width() * offset_percent)+'px'
offset_percent = if isNaN(parseFloat(offset)) then 0 else Math.min(100,Math.round(100*offset / currentPlayer.media.duration))

marker_title = String(response.marker.title).replace(/"/g, '"')+' ['+offset_str+']'
$('.mejs-time-rail').append('<span class="fa fa-chevron-up scrubber-marker" style="left: '+offset+'" title="'+marker_title+'" data-marker='+response.id+'></span>')
$('.mejs-time-total').append('<span class="fa fa-chevron-up scrubber-marker" style="left: '+offset_percent+'%" title="'+marker_title+'" data-marker='+response.id+'></span>')
new_marker.find('button.edit_marker').click(enableMarkerEditForm);
new_marker.find('.edit_avalon_marker').on('ajax:success', handle_edit_save).on 'ajax:error', (e, xhr, status, error) ->
alert 'Request failed.'
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/me-add-to-playlist.css.scss.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.scrubber-marker {
width: 1em !important;
bottom: 0;
transform: translate(-50%,100%)
}

.mejs-controls .mejs-add-to-playlist button, .mejs-controls .mejs-add-marker-to-playlist-item button {
background-size: 23pt !important;
background-position: 50% !important;
Expand Down

0 comments on commit fd9c084

Please sign in to comment.