This commit is contained in:
parent
2a5953a106
commit
4f83aa1239
5
popup.js
5
popup.js
|
@ -126,8 +126,9 @@ function doDelete() {
|
|||
document.getElementById('confirm').addEventListener('click', e => {
|
||||
let cmd = e.target.dataset.cmd;
|
||||
if (cmd === 'ok') {
|
||||
deleteStyle(document.getElementById('confirm').dataset.id);
|
||||
window.close();
|
||||
deleteStyle(document.getElementById('confirm').dataset.id, () => {
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
//
|
||||
if (cmd) {
|
||||
|
|
|
@ -164,7 +164,7 @@ function enableStyle(id, enabled) {
|
|||
});
|
||||
}
|
||||
|
||||
function deleteStyle(id) {
|
||||
function deleteStyle(id, callback = function (){}) {
|
||||
getDatabase(function(db) {
|
||||
var tx = db.transaction(["styles"], "readwrite");
|
||||
var os = tx.objectStore("styles");
|
||||
|
@ -173,6 +173,7 @@ function deleteStyle(id) {
|
|||
handleDelete(id);
|
||||
invalidateCache(true);
|
||||
notifyAllTabs({method: "styleDeleted", id: id});
|
||||
callback();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user