app/js/controllers.show.js in mangos-0.0.3 vs app/js/controllers.show.js in mangos-0.0.4
- old
+ new
@@ -20,36 +20,20 @@
});
}
this.init = function() {
console.log("starting show");
-
$("#image").attr("src", "img/blank.png");
-
- $(window).bind("keydown.show", function(event)
- {
- if((event.keyCode == 32 || event.keyCode == 13) && utils.scrollDistanceFromBottom() <= 0)
- {
- event.preventDefault();
- utils.page(utils.page() + 1, book.pageUrls.length);
- }
- else if(event.keyCode == 8)
- {
- event.preventDefault();
- history.back();
- }
- });
-
$("#view-show").show().addClass("current-view");
-
//setTimeout(preloadImages, 5000);
}
this.render = function() {
+ window.scrollTo(0, 0);
+
var index = utils.page();
- window.scrollTo(0, 0);
_(5).times(function() {
$("#image").attr('src', pageUrl(index));
});
if((index + 1) <= book.pageUrls.length) {
@@ -57,11 +41,9 @@
}
}
this.destroy = function() {
console.log("destroying show");
- $(window).unbind(".show");
- $("#view-show").unbind("click");
$("#view-show").hide().removeClass("current-view");
}
}