-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toggle Detail-view of file and hide rest if a new one is opened
- Loading branch information
1 parent
dc97c20
commit b0faa71
Showing
4 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$(document).ready(function () { | ||
// Handle click on the button to toggle the detail row | ||
$('a[id^="button-"]').on('click', function (e) { | ||
e.preventDefault(); | ||
|
||
// Get the corresponding file number and detail row | ||
var fileNumber = $(this).attr('id').split('-')[1]; | ||
var detailRow = $('#details-' + fileNumber); | ||
|
||
// Close all other detail rows | ||
$('tr[id^="details-"]').not(detailRow).addClass('hidden'); | ||
|
||
// Remove "down" class from all other chevron icons in the .files table | ||
$('.files i.fa-chevron-down').removeClass('down'); | ||
|
||
// Toggle the visibility of the clicked detail row | ||
detailRow.toggleClass('hidden'); | ||
|
||
// Add "down" class to the clicked chevron icon only if the row is now visible | ||
if (!detailRow.hasClass('hidden')) { | ||
$(this).find('i.fa-chevron-down').addClass('down'); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters