From 2e646729d170a0d79b57ab2f5b5ced93fa129eb7 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 12 Jul 2016 14:35:43 +0100 Subject: [PATCH] avoid clobbering file urls in download dropdown --- .../ide/pdf/controllers/PdfController.coffee | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 635db982c9..b856e6e38d 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -161,18 +161,18 @@ define [ if !response.outputFiles? return + + # prepare list of output files for download dropdown + qs = {} + if response.clsiServerId? + qs.clsiserverid = response.clsiServerId for file in response.outputFiles if IGNORE_FILES.indexOf(file.path) == -1 - # Turn 'output.blg' into 'blg file'. - if file.path.match(/^output\./) - file.name = "#{file.path.replace(/^output\./, "")} file" - else - file.name = file.path - qs = {} - if response.clsiServerId? - qs.clsiserverid = response.clsiServerId - file.url = "/project/#{project_id}/output/#{file.path}" + createQueryString qs - $scope.pdf.outputFiles.push file + $scope.pdf.outputFiles.push { + # Turn 'output.blg' into 'blg file'. + name: if file.path.match(/^output\./) then "#{file.path.replace(/^output\./, "")} file" else file.path + url: "/project/#{project_id}/output/#{file.path}" + createQueryString qs + } fetchLogs = (logFile, blgFile) ->