Fix clipper spinning wait cursor remaining after clipping
This commit is contained in:
1 parent
728830f561
commit
322cbea864
3 files changed
+40
-4
No files matched your search
@@ -79,6 +79,8 @@ async function handleClip() {
|
||||
const statusBox = document.getElementById('statusBox');
|
||||
statusBox.className = 'status';
|
||||
btn.disabled = true;
|
||||
btn.classList.add('loading');
|
||||
btn.classList.remove('success');
|
||||
btn.textContent = 'Clipping & saving graphics...';
|
||||
|
||||
try {
|
||||
@@ -171,13 +173,27 @@ async function handleClip() {
|
||||
throw new Error(data.error || `HTTP ${res.status}`);
|
||||
}
|
||||
|
||||
btn.classList.remove('loading');
|
||||
btn.classList.add('success');
|
||||
btn.disabled = true;
|
||||
btn.textContent = '✓ Clipped!';
|
||||
|
||||
statusBox.className = 'status ok';
|
||||
statusBox.innerHTML = `✓ Saved to <strong>${notebook}</strong>! <a href="${serverUrl}/?noteId=${data.noteId}" target="_blank" style="color:#fff;text-decoration:underline;margin-left:6px;">Open Note</a>`;
|
||||
btn.textContent = 'Clipped!';
|
||||
|
||||
let closeTimer = setTimeout(() => {
|
||||
window.close();
|
||||
}, 3500);
|
||||
|
||||
statusBox.addEventListener('mouseenter', () => {
|
||||
if (closeTimer) clearTimeout(closeTimer);
|
||||
});
|
||||
} catch (err) {
|
||||
statusBox.className = 'status err';
|
||||
statusBox.textContent = 'Error: ' + (err.message || String(err));
|
||||
btn.disabled = false;
|
||||
btn.classList.remove('loading');
|
||||
btn.classList.remove('success');
|
||||
btn.textContent = 'Save Clip to Everclone';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user