Mercurial > hg > digilib-old
changeset 1044:2d04f160ce09
move slider handle when a new value is entered
author | hertzhaft |
---|---|
date | Fri, 23 Mar 2012 12:17:15 +0100 |
parents | e7733df2e2c4 |
children | 6329b7f8d7f8 |
files | webapp/src/main/webapp/jquery/jquery.digilib.sliders.js webapp/src/main/webapp/jquery/jquery.range.js |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.sliders.js Fri Mar 23 11:54:42 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.sliders.js Fri Mar 23 12:17:15 2012 +0100 @@ -456,14 +456,14 @@ $text.on('change', function () { var val = $text.val(); $range.val(val); - // val() doesn't update handle, but set changes value :-/ - // $range.range('set', val); + if (!HTML5) { + $range.range('set', val); + } }); // handle submit $slider.find('form').on('submit', function () { - console.debug("brgt-form:", this, " sub=", this.sub); + // console.debug("brgt-form:", this, " sub=", this.sub); callback($text.val()); - // digilib.actions.brightness(data, brgt); $slider.remove(); return false; });
--- a/webapp/src/main/webapp/jquery/jquery.range.js Fri Mar 23 11:54:42 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.range.js Fri Mar 23 12:17:15 2012 +0100 @@ -177,7 +177,7 @@ }; var valueToPx = function(val){ - var w = $input.width(); + var w = $input.width()-size; var valspan = options.max - options.min; var valpos = val - options.min; var v = valpos * w / valspan;