mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2025-07-01 14:57:50 +02:00
Update 'show/hide recipes' (expand/collapse) functionality
Previously, it would expand the recipe if currently collapsed, and vice versa. Now, if any recipes are currently expanded, it will collapse all; otherwise, all recipes will be expanded. The 'expand all' functionality is necessary for full-text searching.
This commit is contained in:
22
js/js.js
22
js/js.js
@ -32,11 +32,21 @@ $(document).ready(function() {
|
||||
}
|
||||
})
|
||||
|
||||
// open all windows if button is clicked
|
||||
$('#open-all').on("click", function(){
|
||||
$('input[type=checkbox]').each(function(){
|
||||
this.checked = !this.checked;
|
||||
})
|
||||
});
|
||||
// Collapse all recipes when button is clicked
|
||||
$('#toggle-expand-collapse-all').on("click", function(){
|
||||
var checkboxes = $('input[type=checkbox]');
|
||||
var anyRecipesOpen = $(checkboxes).is(':checked');
|
||||
|
||||
if (anyRecipesOpen) {
|
||||
// Collapse all
|
||||
$('input[type=checkbox]').each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
} else new Promise(function(resolve, reject) {
|
||||
// Expand all
|
||||
$('input[type=checkbox]').each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user