Skip to content
Browse files

fix values used in form submission

  • Loading branch information...
1 parent c288ae2 commit 733a999989e0d9e6fe08b8f9503923082769cf93 Frank Yan committed Oct 5, 2011
Showing with 10 additions and 8 deletions.
  1. +10 −8 html5slider.js
View
18 html5slider.js
@@ -109,17 +109,19 @@ function transform(slider) {
}
// reimplement value and type properties
- slider.__defineGetter__('value', function() {
- return '' + value;
- });
- slider.__defineSetter__('value', function(val) {
+ var getValue = function() { return '' + value; };
+ var setValue = function setValue(val) {
value = '' + val;
isValueSet = true;
draw();
- });
- slider.__defineGetter__('type', function() {
- return 'range';
- });
+ delete slider.value;
+ slider.value = value;
+ slider.__defineGetter__('value', getValue);
+ slider.__defineSetter__('value', setValue);
+ };
+ slider.__defineGetter__('value', getValue);
+ slider.__defineSetter__('value', setValue);
+ slider.__defineGetter__('type', function() { return 'range'; });
// sync properties with attributes
['min', 'max', 'step'].forEach(function(prop) {

0 comments on commit 733a999

Please sign in to comment.
Something went wrong with that request. Please try again.