mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Made preview also save the edit.
This commit is contained in:
11
popup.js
11
popup.js
@@ -522,6 +522,9 @@ function runThePopup() {
|
|||||||
//edit is currently open, use that time
|
//edit is currently open, use that time
|
||||||
|
|
||||||
skipTime = getSponsorTimeEditTimes("startTime", index);
|
skipTime = getSponsorTimeEditTimes("startTime", index);
|
||||||
|
|
||||||
|
//save the edit
|
||||||
|
saveSponsorTimeEdit(index, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
@@ -618,7 +621,7 @@ function runThePopup() {
|
|||||||
return parseInt(minutes.value) * 60 + parseFloat(seconds.value);
|
return parseInt(minutes.value) * 60 + parseFloat(seconds.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveSponsorTimeEdit(index) {
|
function saveSponsorTimeEdit(index, closeEditMode = true) {
|
||||||
sponsorTimes[index][0] = getSponsorTimeEditTimes("startTime", index);
|
sponsorTimes[index][0] = getSponsorTimeEditTimes("startTime", index);
|
||||||
sponsorTimes[index][1] = getSponsorTimeEditTimes("endTime", index);
|
sponsorTimes[index][1] = getSponsorTimeEditTimes("endTime", index);
|
||||||
|
|
||||||
@@ -636,9 +639,11 @@ function runThePopup() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
displaySponsorTimes();
|
if (closeEditMode) {
|
||||||
|
displaySponsorTimes();
|
||||||
|
|
||||||
showSubmitTimesIfNecessary();
|
showSubmitTimesIfNecessary();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//deletes the sponsor time submitted at an index
|
//deletes the sponsor time submitted at an index
|
||||||
|
|||||||
Reference in New Issue
Block a user