Skip to content

Commit

Permalink
Add build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Feb 4, 2016
1 parent 4b4d897 commit 2321b41
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions dist/hawkular-ui-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,29 +893,21 @@ var hawkularRest;
handle: function (jdrResponse, binaryData) {
var message;
if (jdrResponse.status === "OK") {
message = 'JDR generated';
var reportFileName = jdrResponse.fileName;
var a = document.createElement("a");
document.body.appendChild(a);
a.style.display = "none";
var url = URL.createObjectURL(binaryData);
a.href = url;
a['download'] = reportFileName;
a.click();
setTimeout(function () {
document.body.removeChild(a);
URL.revokeObjectURL(url);
}, 100);
$rootScope.$broadcast('ExportJDRSuccess', message);
var urlWithFileName = {
url: URL.createObjectURL(binaryData),
fileName: jdrResponse.fileName,
jdrResponse: jdrResponse
};
$rootScope.$broadcast('ExportJDRSuccess', urlWithFileName);
}
else if (jdrResponse.status === "ERROR") {
message = 'Export of JDR failed: ' + jdrResponse.message;
$rootScope.$broadcast('ExportJDRError', message);
$rootScope.$broadcast('ExportJDRError', { message: message, jdrResponse: jdrResponse });
}
else {
message = 'Export of JDR failed: ' + jdrResponse.message;
console.error('Unexpected ExportJdrResponse: ', jdrResponse);
$rootScope.$broadcast('ExportJDRError', message);
$rootScope.$broadcast('ExportJDRError', { message: message, jdrResponse: jdrResponse });
}
}
},
Expand Down

0 comments on commit 2321b41

Please sign in to comment.