Enable infinite signature navigation and improve button logic
Updated the `disabled` attribute logic in `EnvelopeViewer.razor` to ensure navigation buttons are always active when signatures exist. Modified `pdf-viewer.js` to enable infinite looping for signature navigation, allowing users to cycle between the first and last signatures seamlessly. Adjusted `canGoPrev` and `canGoNext` properties to depend on the total number of signatures, ensuring navigation is always enabled when signatures are present.
This commit is contained in:
@@ -509,9 +509,9 @@ window.pdfViewer = {
|
||||
total: total,
|
||||
signed: signed,
|
||||
unsigned: unsigned,
|
||||
currentIndex: signed, // Sonraki imzan?n index'i
|
||||
canGoPrev: signed > 0, // En az 1 imza uygulanm?? m??
|
||||
canGoNext: unsigned > 0 // Hala imzalanmam?? var m??
|
||||
currentIndex: signed,
|
||||
canGoPrev: total > 0, // Her zaman aktif (e?er imza varsa)
|
||||
canGoNext: total > 0 // Her zaman aktif (e?er imza varsa)
|
||||
};
|
||||
},
|
||||
|
||||
@@ -533,9 +533,11 @@ window.pdfViewer = {
|
||||
}
|
||||
|
||||
// Bir sonraki imzay? al (imzalanm?? olup olmad???na bakmadan)
|
||||
const nextIndex = currentIndex + 1;
|
||||
let nextIndex = currentIndex + 1;
|
||||
|
||||
// Sonsuz döngü: Son imzadaysa ilk imzaya dön
|
||||
if (nextIndex >= this._allSignatures.length) {
|
||||
return false; // Son imzaday?z
|
||||
nextIndex = 0; // ?lk imzaya dön
|
||||
}
|
||||
|
||||
const nextSignature = this._allSignatures[nextIndex];
|
||||
@@ -608,9 +610,11 @@ window.pdfViewer = {
|
||||
}
|
||||
|
||||
// Bir önceki imzay? al
|
||||
const prevIndex = currentIndex - 1;
|
||||
let prevIndex = currentIndex - 1;
|
||||
|
||||
// Sonsuz döngü: ?lk imzadaysa son imzaya git
|
||||
if (prevIndex < 0) {
|
||||
return false; // ?lk imzaday?z
|
||||
prevIndex = this._allSignatures.length - 1; // Son imzaya git
|
||||
}
|
||||
|
||||
const prevSignature = this._allSignatures[prevIndex];
|
||||
|
||||
Reference in New Issue
Block a user