image enhancement reset button
This commit is contained in:
parent
41626d8ab7
commit
1403e1e01c
1 changed files with 13 additions and 4 deletions
|
@ -178,8 +178,8 @@ function ComicBook(id, srcs, opts) {
|
|||
ComicBook.prototype.enhance.brightness({ contrast: ui.value });
|
||||
}
|
||||
}))
|
||||
.append("<input type='checkbox' id='desaturate' />")
|
||||
.append("<label for='desaturate'>Desaturate</label>")
|
||||
.append("<input type='checkbox' id='desaturate' /> <label for='desaturate'>Desaturate</label>")
|
||||
.append("<button id='reset' style='display:block'>reset</button>")
|
||||
.css({
|
||||
position: "absolute",
|
||||
top: "40%",
|
||||
|
@ -217,12 +217,21 @@ function ComicBook(id, srcs, opts) {
|
|||
.after(this.getControl("image").hide());
|
||||
|
||||
$("#desaturate").click(function(e){
|
||||
if (this.checked) {
|
||||
if ($(this).is(":checked")) {
|
||||
ComicBook.prototype.enhance.desaturate();
|
||||
} else {
|
||||
ComicBook.prototype.enhance.resaturate();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$("#reset").click(function(e){
|
||||
// TODO: improve performance here.
|
||||
$("#brightness").slider("value", 0)
|
||||
$("#saturation").slider("value", 0);
|
||||
var desaturate = $("#desaturate");
|
||||
desaturate.attr("checked", !desaturate.attr("checked"));
|
||||
ComicBook.prototype.enhance.reset();
|
||||
});
|
||||
};
|
||||
|
||||
ComicBook.prototype.getControl = function(control) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue