Skip to content

Commit

Permalink
Bulk export improvements (#871)
Browse files Browse the repository at this point in the history
- Open direct bulk export to ”<option>Main” target (i.e. new tab/window) like the single record exports
- Trigger the change function for the initially selected option for consistency
  • Loading branch information
EreMaijala authored and demiankatz committed Dec 21, 2016
1 parent 14ef1fc commit c95871e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions themes/bootstrap3/templates/cart/export.phtml
Expand Up @@ -58,13 +58,20 @@
$script = <<<JS
$('button.btn.hidden').removeClass('hidden');
$('#itemhide').removeClass('in');
$('.export.btn').click(function exportButtonClick() {
if (typeof $('#format option:selected').attr('data-redirect') !== 'undefined') {
VuFind.modal('hide');
}
});
$('#format').change(function exportFormatChange(e) {
if (this.selectedOptions[0].getAttribute('data-redirect') === null) {
$('.export.btn').removeAttr('data-lightbox-ignore');
$('form[name=exportForm]').removeAttr('target');
} else {
$('.export.btn').attr('data-lightbox-ignore', '1');
$('form[name=exportForm]').attr('target', this.selectedOptions[0].value + 'Main');
}
});
}).trigger('change');
JS;
?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?>

0 comments on commit c95871e

Please sign in to comment.