Skip to content

Commit

Permalink
fix: workaround for behavior on safari/ios
Browse files Browse the repository at this point in the history
  • Loading branch information
cleydyr committed Jan 2, 2025
1 parent 41c71e8 commit fd01a3b
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* @author Danniel Willian <danniel@biblivre.org.br>
*
*/

const OPEN_TARGET = "_top"

var Reports = Reports || {};
var CatalogingSearch = CatalogingSearch || {};

Expand Down Expand Up @@ -188,7 +191,7 @@ Reports.generateReport = function() {
if (response.success) {
Core.msg(response);
if (response.file_name) {
window.open(window.location.pathname + '?controller=download&module=administration.reports&action=download_report&file_name=' + response.file_name);
window.open(window.location.pathname + '?controller=download&module=administration.reports&action=download_report&file_name=' + response.file_name, OPEN_TARGET);
}
} else {
Core.msg(response);
Expand Down Expand Up @@ -228,7 +231,7 @@ Reports.generateAuthorReport = function(authorRecord) {
if (response.success) {
Core.msg(response);
if (response.file_name) {
window.open(window.location.pathname + '?controller=download&module=administration.reports&action=download_report&file_name=' + response.file_name);
window.open(window.location.pathname + '?controller=download&module=administration.reports&action=download_report&file_name=' + response.file_name, OPEN_TARGET);
}
} else {
Core.msg(response);
Expand Down Expand Up @@ -267,7 +270,7 @@ Reports.generateUserReport = function(userId) {
if (response.success) {
Core.msg(response);
if (response.file_name) {
window.open(window.location.pathname + '?controller=download&module=administration.reports&action=download_report&file_name=' + response.file_name);
window.open(window.location.pathname + '?controller=download&module=administration.reports&action=download_report&file_name=' + response.file_name, OPEN_TARGET);
}
} else {
Core.msg(response);
Expand Down

0 comments on commit fd01a3b

Please sign in to comment.