video new window popout added

This commit was merged in pull request #734.
This commit is contained in:
victorAnumudu
2024-05-28 20:47:42 +01:00
parent ff129480a5
commit b3c2785a4b
3 changed files with 43 additions and 1 deletions
@@ -16,6 +16,22 @@ export default function MyUploadedFiles({ uploadedFiles }) {
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
//FUNCTION TO OPEN NEW WINDOW
const openNewWindow = (e, url, width=1000, height=600) => {
e.preventDefault()
var leftPosition, topPosition;
//Allow for borders.
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
//Allow for title and status bars.
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
//Open the window.
window.open(url, "",
"status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
+ leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
+ topPosition + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
}
return (
<>
<div className="mb-4 w-full flex justify-end item-center">
@@ -106,6 +122,7 @@ export default function MyUploadedFiles({ uploadedFiles }) {
<a
href={downloadLink}
title="download"
onClick={(e)=> openNewWindow(e, downloadLink)}
// className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<img