moved loading status out of toolbar

This commit is contained in:
Bala Clark 2011-09-04 11:37:23 +02:00
parent f080bf88e5
commit 4c1df0f1ea
2 changed files with 23 additions and 12 deletions

View file

@ -66,15 +66,22 @@
box-shadow: none; 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 { #cb-toolbar {
top: 0; top: 0;
border-bottom: 2px solid #444; border-bottom: 2px solid #444;
} }
#cb-toolbar #cb-status {
float: right;
}
#cb-toolbar button { #cb-toolbar button {
height: 32px; height: 32px;
width: 32px; width: 32px;

View file

@ -183,6 +183,10 @@ function ComicBook(id, srcs, opts) {
*/ */
ComicBook.prototype.control = { ComicBook.prototype.control = {
status: $(document.createElement("p"))
.attr("id", "cb-status")
.addClass("cb-control cb-always-on"),
toolbar: $(document.createElement("div")) toolbar: $(document.createElement("div"))
.hide() .hide()
.attr("id", "cb-toolbar") .attr("id", "cb-toolbar")
@ -235,8 +239,7 @@ function ComicBook(id, srcs, opts) {
options.zoomMode = "fitWidth" options.zoomMode = "fitWidth"
ComicBook.prototype.drawPage(); ComicBook.prototype.drawPage();
}) })
) ),
.append("<p id='cb-status'></p>"),
/** /**
* Image enhancements * Image enhancements
@ -293,13 +296,13 @@ function ComicBook(id, srcs, opts) {
navigation: { navigation: {
left: $(document.createElement("div")) left: $(document.createElement("div"))
.addClass("cb-control cb-navigate left") .addClass("cb-control cb-navigate cb-always-on left")
.click(function(e){ .click(function(e){
ComicBook.prototype.drawPrevPage(); ComicBook.prototype.drawPrevPage();
}), }),
right: $(document.createElement("div")) right: $(document.createElement("div"))
.addClass("cb-control cb-navigate right") .addClass("cb-control cb-navigate cb-always-on right")
.click(function(e) { .click(function(e) {
ComicBook.prototype.drawNextPage(); 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 * TODO: center, make sure they never leave the visible portion of the screen
*/ */
ComicBook.prototype.renderControls = function() { ComicBook.prototype.renderControls = function() {
$(canvas) $(canvas)
.before(this.getControl("loadingIndicator").hide()) .before(this.getControl("loadingIndicator"))
.before(this.getControl("status"))
.after(this.getControl("toolbar")) .after(this.getControl("toolbar"))
.after(this.getControl("navigation").left) .after(this.getControl("navigation").left)
.after(this.getControl("navigation").right) .after(this.getControl("navigation").right)
@ -369,7 +373,7 @@ function ComicBook(id, srcs, opts) {
ComicBook.prototype.toggleToolbar = function() { ComicBook.prototype.toggleToolbar = function() {
if ($("#cb-toolbar").is(":visible")) { if ($("#cb-toolbar").is(":visible")) {
$(".cb-control").not(".cb-navigate").hide(); $(".cb-control").not(".cb-always-on").hide();
} else { } else {
$("#cb-toolbar, .cb-control.open").show(); $("#cb-toolbar, .cb-control.open").show();
} }
@ -497,7 +501,7 @@ function ComicBook(id, srcs, opts) {
ComicBook.prototype.drawPage(); ComicBook.prototype.drawPage();
ComicBook.prototype.hideControl("loadingIndicator"); ComicBook.prototype.hideControl("loadingIndicator");
} }
if (loaded.length === no_pages) { $("#cb-status").remove(); } if (loaded.length === no_pages) { ComicBook.prototype.hideControl("status") }
}; };
} }