Skip to content

Commit

Permalink
Merge pull request #5517 from avalonmediasystem/disabled-option-fix
Browse files Browse the repository at this point in the history
Fix disabled current-track option behavior
  • Loading branch information
Dananji authored Dec 11, 2023
2 parents 7163084 + d584129 commit 2c63954
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/ramp_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,14 @@ function disableEnableCurrentTrack(activeTrack, currentTime, isSeeked, sectionTi
if(times.begin <= starttime && starttime <= times.end) {
$('#playlistitem_scope_track')[0].disabled = false;
$('#current-track-text').removeClass('disabled-option');
$('#playlistitem_scope_track').closest('label').css('cursor', 'pointer');
}
} else {
// Whena activeTrack is undefined, disable the current track option
$('#playlistitem_scope_track')[0].disabled = true;
$('#current-track-name').text('');
$('#current-track-text').addClass('disabled-option');
$('#playlistitem_scope_track').closest('label').css('cursor', 'not-allowed');
if($('#playlistitem_scope_track')[0].checked) {
$('#moreDetails').collapse('hide');
$('#playlistitem_scope_track').prop('checked', false);
Expand Down
8 changes: 4 additions & 4 deletions app/views/media_objects/_add_to_playlist.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ Unless required by applicable law or agreed to in writing, software distributed

<div id="add-to-playlist-form-group">
<div class="form-check">
<label class="form-check-label" onclick="collapseMoreDetails()">
<input type="radio" name="post[playlistitem_scope]" id="playlistitem_scope_track" aria-label="playlist item current track">
<label class="form-check-label">
<input type="radio" onclick="collapseMoreDetails()" name="post[playlistitem_scope]" id="playlistitem_scope_track" aria-label="playlist item current track">
<span id="current-track-text">Current Track (<span id="current-track-name"></span>)</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" onclick="collapseMoreDetails()">
<input type="radio" name="post[playlistitem_scope]" id="playlistitem_timeselection" aria-label="playlist item time selection">
<label class="form-check-label">
<input type="radio" onclick="collapseMoreDetails()" name="post[playlistitem_scope]" id="playlistitem_timeselection" aria-label="playlist item time selection">
Time Selection
</label>
<input type="text" name="playlist_item_start" id="playlist_item_start" pattern="(\d+:){0,2}\d+(\.\d+)?" value="" aria-label="start time">
Expand Down

0 comments on commit 2c63954

Please sign in to comment.