1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

updated how tasks are added to queue

This commit is contained in:
fchasen 2014-12-04 19:58:07 -05:00
parent ee19c03287
commit 338bc64884
5 changed files with 1540 additions and 2092 deletions

View file

@ -143,41 +143,29 @@ EPUBJS.Rendition.prototype.bounds = function() {
};
EPUBJS.Rendition.prototype.display = function(what){
var displaying = new RSVP.defer();
var displayed = displaying.promise;
return this.q.enqueue(this.load, what);
// Check for fragments
if(typeof what === 'string') {
what = what.split("#")[0];
}
this.q.enqueue(this.move, what);
return displayed;
};
EPUBJS.Rendition.prototype.move = function(what){
EPUBJS.Rendition.prototype.load = function(what){
var displaying = new RSVP.defer();
var displayed = displaying.promise;
var section = this.book.spine.get(what);
var view;
this.displaying = true;
if(section){
view = new EPUBJS.View(section);
// Clear views
// this.clear();
// This will clear all previous views
this.fill(view);
// rendered = this.render(section);
// Move to correct place within the section, if needed
// this.moveTo(what)
// if(this.settings.infinite) {
// rendered.then(function(){
// return this.fill.call(this);
// }.bind(this));
// }
this.check();
view.displayed.then(function(){
@ -193,6 +181,11 @@ EPUBJS.Rendition.prototype.move = function(what){
return displayed;
};
// Takes a cfi, fragment or page?
EPUBJS.Rendition.prototype.moveTo = function(what){
};
EPUBJS.Rendition.prototype.render = function(view) {
// var view = new EPUBJS.View(section);
//