I won’t be adding a deselect, but it is easy for you to add one yourself.
- create a folder ‘nggallery’ in your theme’s folder
- copy the download template from the templates folder in the plugin into that new folder
- duplicate the line with the selectall button and change ‘ngg-download-selectall’ to ‘ngg-download-selectnone’
- add the following code to the block of jQuery code:
$("input.ngg-download-selectnone").show().click(function() {
$(this).closest("form").find("input[name='pid[]']").prop({checked: false});
});
cheers,
Ross
Thread Starter
H R
(@hnfr)
Awesome help Ross.
I’ve tried already and works just fine!
Cheers,
Hugo
Thank you for this!
I did it in my own way, creating one button with Select/Deselect and adding this code
var $selected = 0;
<?php /* reveal "select all" button and active it */ ?>
$("input.ngg-download-selectall").show().click(function() {
if ($selected == 0) {
$(this.form).find("input[name='pid[]']").prop({checked: true});
$selected = 1;
} else {
$(this).closest("form").find("input[name='pid[]']").prop({checked: false});
$selected = 0;
}
});
I’m sure there’s a more elegant way of doing this, but this was the most simple.
By the way, why is not all buttons linked to the language files? I can’t, for instance, find the select all text in the po-file.
G’day Marcus,
I recently added the “select all” text to the .po files (oops!) so the next release will have that. Of course, the text might be a bit funny because I used Google Translate to do it 🙂 but at least it won’t be English for every language. Translation fixes are always welcome!
cheers,
Ross