##// END OF EJS Templates
Add float implementation of range widget
Add float implementation of range widget

File last commit:

r15427:3bb7cf6a
r17060:6b57c5bb
Show More
widget_float.js
42 lines | 1.4 KiB | application/javascript | JavascriptLexer
Jonathan Frederic
Added standard IPY JS header to widget JS files.
r14366 //----------------------------------------------------------------------------
// Copyright (C) 2013 The IPython Development Team
//
// Distributed under the terms of the BSD License. The full license is in
// the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------
Jonathan Frederic
Move js *RangeWidget code into *Widget
r14672 //============================================================================
// FloatWidget
//============================================================================
/**
* @module IPython
* @namespace IPython
**/
Jonathan Frederic
Updated require references to point to new files
r15427 define(["widgets/js/widget",
"widgets/js/widget_int"],
Jonathan Frederic
Float widget views now inherit from int counterparts
r14694 function(WidgetManager, int_widgets){
Jonathan Frederic
Move js *RangeWidget code into *Widget
r14672
Jonathan Frederic
Float widget views now inherit from int counterparts
r14694 var IntSliderView = int_widgets[0];
var IntTextView = int_widgets[1];
Jonathan Frederic
Move js *RangeWidget code into *Widget
r14672
Jonathan Frederic
Float widget views now inherit from int counterparts
r14694 var FloatSliderView = IntSliderView.extend({
_validate_slide_value: function(x) {
// Validate the value of the slider before sending it to the back-end
// and applying it to the other views on the page.
return x;
Jonathan Frederic
Move js *RangeWidget code into *Widget
r14672 },
});
WidgetManager.register_widget_view('FloatSliderView', FloatSliderView);
MinRK
quick review pass on javascript
r14792 var FloatTextView = IntTextView.extend({
Jonathan Frederic
Float widget views now inherit from int counterparts
r14694 _parse_value: function(value) {
// Parse the value stored in a string.
return parseFloat(value);
Jonathan Frederic
Move js *RangeWidget code into *Widget
r14672 },
});
WidgetManager.register_widget_view('FloatTextView', FloatTextView);
});