mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 03:57:09 +03:00
Made preview also save the edit.
This commit is contained in:
7
popup.js
7
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,10 +639,12 @@ function runThePopup() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (closeEditMode) {
|
||||||
displaySponsorTimes();
|
displaySponsorTimes();
|
||||||
|
|
||||||
showSubmitTimesIfNecessary();
|
showSubmitTimesIfNecessary();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//deletes the sponsor time submitted at an index
|
//deletes the sponsor time submitted at an index
|
||||||
function deleteSponsorTime(index) {
|
function deleteSponsorTime(index) {
|
||||||
|
|||||||
Reference in New Issue
Block a user