Enhance signature navigation with current index display
Added functionality to display the current signature index in the signature counter UI in `EnvelopeViewer.razor`, including a new state variable `_currentSignatureIndex` to track the currently viewed signature. Updated the logic to fetch and set this value from the `SignatureNavState` object provided by the JavaScript runtime. Modified `pdf-viewer.js` to calculate the current signature index based on the last viewed signature ID (`_lastViewedSignatureId`) and return it as part of the `SignatureNavState`. This replaces the previously hardcoded `signed` value. These changes improve the user experience by providing a clear indication of the currently viewed signature in the navigation UI.
This commit is contained in:
@@ -505,11 +505,18 @@ window.pdfViewer = {
|
||||
const signed = this.appliedSignatures.length; // ?mzalananlar
|
||||
const unsigned = total - signed; // Hesaplanan: ?mzalanmayanlar
|
||||
|
||||
// Mevcut görüntülenen imzanın sıra numarasını bul
|
||||
let currentIndex = 0;
|
||||
if (this._lastViewedSignatureId) {
|
||||
const index = this._allSignatures.findIndex(s => s.id === this._lastViewedSignatureId);
|
||||
currentIndex = index !== -1 ? index + 1 : 0; // 1-based index (kullanıcıya göstermek için)
|
||||
}
|
||||
|
||||
return {
|
||||
total: total,
|
||||
signed: signed,
|
||||
unsigned: unsigned,
|
||||
currentIndex: signed,
|
||||
currentIndex: currentIndex, // Şu an hangi imzada (1-5 arası)
|
||||
canGoPrev: total > 0, // Her zaman aktif (e?er imza varsa)
|
||||
canGoNext: total > 0 // Her zaman aktif (e?er imza varsa)
|
||||
};
|
||||
@@ -1017,3 +1024,4 @@ window.pdfViewer = {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user