add back and refresh buttons to export view

pull/3054/head
Andrew Bauer 2020-09-27 12:43:12 -05:00
parent 3b46ebacae
commit 699cbed6af
2 changed files with 25 additions and 4 deletions

View File

@ -63,10 +63,15 @@ xhtmlHeaders(__FILE__, translate('Export'));
<body>
<div id="page">
<?php echo getNavBarHTML() ?>
<div id="header">
<h2><?php echo translate('ExportOptions') ?></h2>
</div>
<div id="content">
<div class="w-100 py-1">
<div class="float-left pl-3">
<button type="button" id="backBtn" class="btn btn-normal" data-toggle="tooltip" data-placement="top" title="<?php echo translate('Back') ?>" disabled><i class="fa fa-arrow-left"></i></button>
<button type="button" id="refreshBtn" class="btn btn-normal" data-toggle="tooltip" data-placement="top" title="<?php echo translate('Refresh') ?>" ><i class="fa fa-refresh"></i></button>
</div>
<div class="w-100 pt-2">
<h2><?php echo translate('ExportOptions') ?></h2>
</div>
</div> <div id="content">
<form name="contentForm" id="contentForm" method="post" action="?view=export">
<input type="hidden" name="connkey" value="<?php echo $connkey; ?>"/>
<?php

View File

@ -104,12 +104,28 @@ function initPage() {
startDownload.pass(exportFile).delay(1500);
}
document.getElementById('exportButton').addEventListener('click', exportEvents);
// Manage the eventdetail link in the export list
$j(".eDetailLink").click(function(evt) {
evt.preventDefault();
var eid = $j(this).data('eid');
getEventDetailModal(eid);
});
// Manage the BACK button
document.getElementById("backBtn").addEventListener("click", function onBackClick(evt) {
evt.preventDefault();
window.history.back();
});
// Don't enable the back button if there is no previous zm page to go back to
$j('#backBtn').prop('disabled', !document.referrer.length);
// Manage the REFRESH Button
document.getElementById("refreshBtn").addEventListener("click", function onRefreshClick(evt) {
evt.preventDefault();
window.location.reload(true);
});
}
window.addEventListener('DOMContentLoaded', initPage);