image enhancement reset button

This commit is contained in:
Bala Clark 2011-08-30 23:55:22 +02:00
parent 41626d8ab7
commit 1403e1e01c

View file

@ -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) {