##// END OF EJS Templates
Add support to the float slider
Gordon Ball -
Show More
@@ -1,30 +1,34 b''
1 1 // Copyright (c) IPython Development Team.
2 2 // Distributed under the terms of the Modified BSD License.
3 3
4 4 define([
5 5 "widgets/js/widget",
6 6 "widgets/js/widget_int",
7 7 ], function(widget, int_widgets){
8 8 var IntSliderView = int_widgets.IntSliderView;
9 9 var IntTextView = int_widgets.IntTextView;
10 10
11 11 var FloatSliderView = IntSliderView.extend({
12 _validate_text_input: function(x) {
13 return parseFloat(x);
14 },
15
12 16 _validate_slide_value: function(x) {
13 17 // Validate the value of the slider before sending it to the back-end
14 18 // and applying it to the other views on the page.
15 19 return x;
16 20 },
17 21 });
18 22
19 23 var FloatTextView = IntTextView.extend({
20 24 _parse_value: function(value) {
21 25 // Parse the value stored in a string.
22 26 return parseFloat(value);
23 27 },
24 28 });
25 29
26 30 return {
27 31 'FloatSliderView': FloatSliderView,
28 32 'FloatTextView': FloatTextView,
29 33 };
30 34 });
General Comments 0
You need to be logged in to leave comments. Login now