From 7760c0470e387263ddeadbe68251e1fb8cbfd71d Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Fri, 2 Sep 2011 20:28:41 +0200 Subject: [PATCH] redraw comic on window resize --- examples/basic.html | 2 ++ lib/ComicBook.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/basic.html b/examples/basic.html index 65a4cbd..007f70d 100755 --- a/examples/basic.html +++ b/examples/basic.html @@ -40,6 +40,8 @@ ] ); book.draw(); + + window.onresize = book.drawPage; diff --git a/lib/ComicBook.js b/lib/ComicBook.js index ef9aca2..5096a40 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -428,8 +428,8 @@ function ComicBook(id, srcs, opts) { var zoom_scale; var offsetW = 0, offsetH = 0; - var page = this.getPage(pointer); - var page2 = this.getPage(pointer + 1); + var page = ComicBook.prototype.getPage(pointer); + var page2 = ComicBook.prototype.getPage(pointer + 1); if (typeof page !== "object") { throw new ComicBookException(ComicBookException.INVALID_PAGE_TYPE, typeof page); @@ -729,5 +729,5 @@ function ComicBook(id, srcs, opts) { return false; } }; - + }