diff options
author | Ajay Ramachandran <[email protected]> | 2019-08-12 12:26:52 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-08-12 12:26:52 -0400 |
commit | ac118173a50d47fa6ad6e69f0024e4cf07b162e3 (patch) | |
tree | c139e173188046d69adf9cc0ff28bd744bbd88b8 /popup.js | |
parent | 3f815a18c4b507e6622824c371e7aabfc72b4f6d (diff) | |
download | SponsorBlock-ac118173a50d47fa6ad6e69f0024e4cf07b162e3.tar.gz SponsorBlock-ac118173a50d47fa6ad6e69f0024e4cf07b162e3.zip |
Made preview also save the edit.
Diffstat (limited to 'popup.js')
-rw-r--r-- | popup.js | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -522,6 +522,9 @@ function runThePopup() { //edit is currently open, use that time skipTime = getSponsorTimeEditTimes("startTime", index); + + //save the edit + saveSponsorTimeEdit(index, false); } chrome.tabs.query({ @@ -618,7 +621,7 @@ function runThePopup() { return parseInt(minutes.value) * 60 + parseFloat(seconds.value); } - function saveSponsorTimeEdit(index) { + function saveSponsorTimeEdit(index, closeEditMode = true) { sponsorTimes[index][0] = getSponsorTimeEditTimes("startTime", 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 |