Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
search-commons-webresources
Commits
a4b44de3
Commit
a4b44de3
authored
Aug 13, 2019
by
Gradl, Tobias
Browse files
1315: Download button for MWW instance (iframe based)
Task-Url:
https://pm.winseda.de/issues/1315
parent
e7bc3354
Changes
1
Show whitespace changes
Inline
Side-by-side
js/item/item.js
View file @
a4b44de3
...
...
@@ -109,5 +109,23 @@ ResultItem.prototype.loadData = function(dataType, containerSelector, contentSel
error
:
__util
.
processServerError
});
}
};
ResultItem
.
prototype
.
downloadData
=
function
(
format
,
model
)
{
var
_this
=
this
;
$
.
ajax
({
url
:
window
.
location
.
href
+
"
download?format=
"
+
format
+
"
&type=
"
+
model
,
type
:
"
GET
"
,
dataType
:
"
json
"
,
success
:
function
(
data
)
{
if
(
window
.
location
!==
window
.
parent
.
location
)
{
// The page is in an iframe
window
.
parent
.
postMessage
(
data
,
'
*
'
);
}
else
{
// The page is not in an iframe
console
.
log
(
data
);
}
},
error
:
__util
.
processServerError
});
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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