diff --git a/css/styles.css b/css/styles.css index e091475..6385f41 100644 --- a/css/styles.css +++ b/css/styles.css @@ -66,15 +66,22 @@ box-shadow: none; } +#cb-status { + z-index: 101; + font-size: 12px; + right: 0; + bottom: 0; + margin: 8px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + #cb-toolbar { top: 0; border-bottom: 2px solid #444; } -#cb-toolbar #cb-status { - float: right; -} - #cb-toolbar button { height: 32px; width: 32px; diff --git a/lib/ComicBook.js b/lib/ComicBook.js index 3ec0209..a7f6887 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -183,6 +183,10 @@ function ComicBook(id, srcs, opts) { */ ComicBook.prototype.control = { + status: $(document.createElement("p")) + .attr("id", "cb-status") + .addClass("cb-control cb-always-on"), + toolbar: $(document.createElement("div")) .hide() .attr("id", "cb-toolbar") @@ -235,8 +239,7 @@ function ComicBook(id, srcs, opts) { options.zoomMode = "fitWidth" ComicBook.prototype.drawPage(); }) - ) - .append("
"), + ), /** * Image enhancements @@ -293,13 +296,13 @@ function ComicBook(id, srcs, opts) { navigation: { left: $(document.createElement("div")) - .addClass("cb-control cb-navigate left") + .addClass("cb-control cb-navigate cb-always-on left") .click(function(e){ ComicBook.prototype.drawPrevPage(); }), right: $(document.createElement("div")) - .addClass("cb-control cb-navigate right") + .addClass("cb-control cb-navigate cb-always-on right") .click(function(e) { ComicBook.prototype.drawNextPage(); }) @@ -314,9 +317,10 @@ function ComicBook(id, srcs, opts) { * TODO: center, make sure they never leave the visible portion of the screen */ ComicBook.prototype.renderControls = function() { - + $(canvas) - .before(this.getControl("loadingIndicator").hide()) + .before(this.getControl("loadingIndicator")) + .before(this.getControl("status")) .after(this.getControl("toolbar")) .after(this.getControl("navigation").left) .after(this.getControl("navigation").right) @@ -369,7 +373,7 @@ function ComicBook(id, srcs, opts) { ComicBook.prototype.toggleToolbar = function() { if ($("#cb-toolbar").is(":visible")) { - $(".cb-control").not(".cb-navigate").hide(); + $(".cb-control").not(".cb-always-on").hide(); } else { $("#cb-toolbar, .cb-control.open").show(); } @@ -497,7 +501,7 @@ function ComicBook(id, srcs, opts) { ComicBook.prototype.drawPage(); ComicBook.prototype.hideControl("loadingIndicator"); } - if (loaded.length === no_pages) { $("#cb-status").remove(); } + if (loaded.length === no_pages) { ComicBook.prototype.hideControl("status") } }; }