Jeremy Schomery 2017-03-13 19:18:00 +03:30
parent 2a5953a106
commit 4f83aa1239
2 changed files with 5 additions and 3 deletions

View File

@ -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) {

View File

@ -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();
};
});
}