##// END OF EJS Templates
Catch errors after our then()s, instead of in parallel with them (this missing exceptions)...
Catch errors after our then()s, instead of in parallel with them (this missing exceptions) When an error is thrown in a then() success handler, it doesn't call the same then()'s error handler. I also made all of the utils.reject handlers verbose to aid in debugging.

File last commit:

r17957:e4c20692
r19080:cbc9dc59
Show More
widget_float.js
32 lines | 1016 B | application/javascript | JavascriptLexer
// Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
define([
"widgets/js/widget",
"widgets/js/widget_int",
], function(widget, int_widgets){
var IntSliderView = int_widgets.IntSliderView;
var IntTextView = int_widgets.IntTextView;
var FloatSliderView = IntSliderView.extend({
_parse_value: parseFloat,
// matches: whitespace?, float, whitespace?, [-:], whitespace?, float
_range_regex: /^\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][+-]?\d+)?)\s*[-:]\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][+-]?\d+)?)/,
_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;
},
});
var FloatTextView = IntTextView.extend({
_parse_value: parseFloat
});
return {
'FloatSliderView': FloatSliderView,
'FloatTextView': FloatTextView,
};
});