added destroy method

This commit is contained in:
Bala Clark 2013-05-01 11:13:25 +02:00
parent 71aceb4ef0
commit d53dc0fc9b
3 changed files with 45 additions and 30 deletions

View file

@ -894,4 +894,16 @@ function ComicBook(id, srcs, opts) {
}
};
ComicBook.prototype.destroy = function () {
$("#cb-loading-overlay, #cb-status, #cb-color, .cb-control, .cb-toolbar, #cb-width-shiv").remove();
canvas.width = 0;
canvas.height = 0;
window.removeEventListener("keydown", ComicBook.prototype.navigation, false);
window.removeEventListener("hashchange", checkHash, false);
setHash('');
$(this).trigger("destroy");
}
}