Skip to content
Snippets Groups Projects
Commit 9335b46a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

downloading is donw in a new tab

parent e97639c2
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -16,9 +16,6 @@ function Panel(params) {
self.setElement(params.element);
self.setMap(params.customMap);
if (self.getHiddenIFrame() === undefined) {
self.addHiddenIFrame();
}
}
Panel.prototype = Object.create(ObjectWithListeners.prototype);
......@@ -253,27 +250,15 @@ Panel.prototype.createSubMapLink = function(label, element) {
return result;
};
Panel.prototype.getHiddenIFrame = function() {
return this.getElementByName(this.getElement(), "hidden-download-iframe");
};
Panel.prototype.downloadFile = function(url) {
this.getHiddenIFrame().src = url;
};
Panel.prototype.addHiddenIFrame = function() {
var iframe = document.createElement("iframe");
iframe.setAttribute("name", "hidden-download-iframe");
iframe.style.display = "none";
this.getElement().appendChild(iframe);
this._downloadFile = url;
window.open(url, '_blank');
};
Panel.prototype.getLastDownloadUrl = function() {
return this.getHiddenIFrame().src;
return this._downloadFile;
};
Panel.prototype.getElementByName = function(element, name) {
if (element !== undefined) {
if (element.getAttribute("name") === name) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment