##// END OF EJS Templates
Only send diff message if diff isn't corrupt....
Only send diff message if diff isn't corrupt. Diff will corrupt if more then one model.set(...) call is made before model.save (or view.touch() in our case).

File last commit:

r14792:de90ea18
r15279:10a4633c
Show More
widget_float.js
42 lines | 1.4 KiB | application/javascript | JavascriptLexer
//----------------------------------------------------------------------------
// 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.
//----------------------------------------------------------------------------
//============================================================================
// FloatWidget
//============================================================================
/**
* @module IPython
* @namespace IPython
**/
define(["notebook/js/widgets/widget",
"notebook/js/widgets/widget_int"],
function(WidgetManager, int_widgets){
var IntSliderView = int_widgets[0];
var IntTextView = int_widgets[1];
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;
},
});
WidgetManager.register_widget_view('FloatSliderView', FloatSliderView);
var FloatTextView = IntTextView.extend({
_parse_value: function(value) {
// Parse the value stored in a string.
return parseFloat(value);
},
});
WidgetManager.register_widget_view('FloatTextView', FloatTextView);
});