Pull Request branch dev-clone to main #1
|
|
@ -354,7 +354,9 @@ export default function AssessmentResultPage() {
|
||||||
|
|
||||||
if (element) {
|
if (element) {
|
||||||
// Sembunyikan elemen yang tidak ingin dicetak
|
// Sembunyikan elemen yang tidak ingin dicetak
|
||||||
|
const buttonPrint = document.getElementById("button-print");
|
||||||
const noPrint = document.getElementById("no-print");
|
const noPrint = document.getElementById("no-print");
|
||||||
|
if (buttonPrint) buttonPrint.style.visibility = 'hidden'; // Menggunakan visibility untuk tetap menjaga ruang
|
||||||
if (noPrint) noPrint.style.visibility = 'hidden'; // Menggunakan visibility untuk tetap menjaga ruang
|
if (noPrint) noPrint.style.visibility = 'hidden'; // Menggunakan visibility untuk tetap menjaga ruang
|
||||||
|
|
||||||
// Pastikan elemen memiliki lebar 100%
|
// Pastikan elemen memiliki lebar 100%
|
||||||
|
|
@ -395,6 +397,7 @@ export default function AssessmentResultPage() {
|
||||||
console.error("Error generating PDF:", err);
|
console.error("Error generating PDF:", err);
|
||||||
} finally {
|
} finally {
|
||||||
// Tampilkan kembali elemen yang disembunyikan
|
// Tampilkan kembali elemen yang disembunyikan
|
||||||
|
if (buttonPrint) buttonPrint.style.visibility = 'visible'; // Mengembalikan visibility
|
||||||
if (noPrint) noPrint.style.visibility = 'visible'; // Mengembalikan visibility
|
if (noPrint) noPrint.style.visibility = 'visible'; // Mengembalikan visibility
|
||||||
element.style.width = ""; // Reset lebar setelah selesai
|
element.style.width = ""; // Reset lebar setelah selesai
|
||||||
}
|
}
|
||||||
|
|
@ -438,7 +441,7 @@ export default function AssessmentResultPage() {
|
||||||
{isSuperAdmin ? (
|
{isSuperAdmin ? (
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<button
|
<button
|
||||||
className="flex items-center text-sm text-blue-600 gap-2 mb-2"
|
className="flex items-center text-sm text-blue-600 gap-2 mb-2" id="no-print"
|
||||||
onClick={() => window.close()}
|
onClick={() => window.close()}
|
||||||
>
|
>
|
||||||
<TbChevronLeft size={20} className="mr-1" />
|
<TbChevronLeft size={20} className="mr-1" />
|
||||||
|
|
@ -454,7 +457,7 @@ export default function AssessmentResultPage() {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex flex-row gap-2" id="no-print">
|
<div className="flex flex-row gap-2" id="button-print">
|
||||||
<button
|
<button
|
||||||
onClick={handlePrintPDF}
|
onClick={handlePrintPDF}
|
||||||
className="bg-blue-600 text-white flex w-fit p-2 rounded-sm text-sm items-start justify-between outline-none ring-offset-0"
|
className="bg-blue-600 text-white flex w-fit p-2 rounded-sm text-sm items-start justify-between outline-none ring-offset-0"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user