From c0ddf82df8d7ae9defb8a79b186c7718c6260595 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Sat, 4 May 2013 10:39:35 +0200 Subject: [PATCH] updated destroy method --- lib/ComicBook.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ComicBook.js b/lib/ComicBook.js index 28c867d..0e2ccad 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -5,6 +5,7 @@ Fo sho: - README with build instructions + - only trigger navigate event on page change (not resize, etc.) - fix manga mode - trigger preload if requesting valid but not loaded images (can happen if network was interupted) - loading and generally hackiness of pointer is buggy, fix. @@ -791,14 +792,19 @@ function ComicBook(id, srcs, opts) { 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.height = 0; + window.removeEventListener("keydown", self.navigation, false); window.removeEventListener("hashchange", checkHash, false); + setHash(''); - $(this).trigger("destroy"); + // $(this).trigger("destroy"); } }