make sure layout button always has the current type as class name
This commit is contained in:
parent
1db2e6483c
commit
bd719688de
1 changed files with 4 additions and 1 deletions
|
@ -184,7 +184,7 @@ function ComicBook(id, srcs, opts) {
|
|||
.append(
|
||||
$(document.createElement("button"))
|
||||
.text("layout")
|
||||
.addClass(options.displayMode)
|
||||
.addClass("cb-layout " + options.displayMode)
|
||||
.click(function(){
|
||||
ComicBook.prototype.toggleLayout();
|
||||
})
|
||||
|
@ -334,10 +334,13 @@ function ComicBook(id, srcs, opts) {
|
|||
|
||||
ComicBook.prototype.toggleLayout = function() {
|
||||
if (options.displayMode === "double") {
|
||||
$("#cb-toolbar .cb-layout").removeClass("double");
|
||||
options.displayMode = "single";
|
||||
} else {
|
||||
$("#cb-toolbar .cb-layout").removeClass("single");
|
||||
options.displayMode = "double";
|
||||
}
|
||||
$("#cb-toolbar .cb-layout").addClass(options.displayMode);
|
||||
ComicBook.prototype.draw();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue