From 30b7b0999d034148284a1d303d7588f013714eed Mon Sep 17 00:00:00 2001 From: Mike Risher Date: Fri, 12 Jun 2020 22:17:44 +0000 Subject: [PATCH] LP#1207744: fix display of duplicate results when viewing report folders When you repeatedly click the link to display a template, report, or output folder on the reports UI, the contents of that folder can display multiple times. This patch addresses this bug and prevents duplicate contents from displaying. Signed-off-by: Mike Risher Signed-off-by: Terran McCanna Signed-off-by: Galen Charlton --- Open-ILS/web/reports/oils_rpt_folder_window.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/reports/oils_rpt_folder_window.js b/Open-ILS/web/reports/oils_rpt_folder_window.js index 488cba6222..b9719951dd 100644 --- a/Open-ILS/web/reports/oils_rpt_folder_window.js +++ b/Open-ILS/web/reports/oils_rpt_folder_window.js @@ -5,7 +5,7 @@ var NG_NEW_TEMPLATE_INTERFACE = '/eg/staff/reporter/template/new'; var NG_CLONE_TEMPLATE_INTERFACE = '/eg/staff/reporter/template/clone'; var OILS_TEMPLATE_INTERFACE = 'xul/template_builder.xul'; var OILS_LEGACY_TEMPLATE_INTERFACE = 'oils_rpt_builder.xhtml'; - +var currentlyLoading = false; /* generic folder window class */ oilsRptSetSubClass('oilsRptFolderWindow', 'oilsRptObject'); @@ -24,6 +24,8 @@ oilsRptFolderWindow.folderIdMap = {}; // Here lie the contents of a specific folder oilsRptFolderWindow.prototype.draw = function(viaPaging) { + if (currentlyLoading) return; // avoids loading same data repeatedly + currentlyLoading=true; _debug('drawing folder window for ' + this.folderNode.folder.name() ); @@ -535,7 +537,6 @@ oilsRptFolderWindow.prototype.createSearchRequest = function() { } oilsRptFolderWindow.prototype.fetchFolderData = function(callback) { - hideMe(DOM.oils_rpt_content_count_row_2); hideMe(DOM.oils_rpt_content_row_2); @@ -605,6 +606,7 @@ oilsRptFolderWindow.prototype.fetchFolderData = function(callback) { } ); } + currentlyLoading=false; } ); req.send(); -- 2.11.0