updated destroy method

This commit is contained in:
Bala Clark 2013-05-04 10:39:35 +02:00
parent 75814daed6
commit c0ddf82df8

View file

@ -5,6 +5,7 @@
Fo sho: Fo sho:
- README with build instructions - README with build instructions
- only trigger navigate event on page change (not resize, etc.)
- fix manga mode - fix manga mode
- trigger preload if requesting valid but not loaded images (can happen if network was interupted) - trigger preload if requesting valid but not loaded images (can happen if network was interupted)
- loading and generally hackiness of pointer is buggy, fix. - loading and generally hackiness of pointer is buggy, fix.
@ -791,14 +792,19 @@ function ComicBook(id, srcs, opts) {
ComicBook.prototype.destroy = function () { ComicBook.prototype.destroy = function () {
$("#cb-loading-overlay, #cb-status, #cb-color, .cb-control, .cb-toolbar, #cb-width-shiv").remove(); $.each(book.controls, function (name, $control) {
$control.remove();
});
canvas.width = 0; canvas.width = 0;
canvas.height = 0; canvas.height = 0;
window.removeEventListener("keydown", self.navigation, false); window.removeEventListener("keydown", self.navigation, false);
window.removeEventListener("hashchange", checkHash, false); window.removeEventListener("hashchange", checkHash, false);
setHash(''); setHash('');
$(this).trigger("destroy"); // $(this).trigger("destroy");
} }
} }