Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
9335b46a
Commit
9335b46a
authored
Jan 25, 2017
by
Piotr Gawron
Browse files
downloading is donw in a new tab
parent
e97639c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/gui/Panel.js
View file @
9335b46a
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment