##// END OF EJS Templates
Reverse hscrollbar min-height hack on OS X...
Reverse hscrollbar min-height hack on OS X OS X has optional behavior to only draw scrollbars during scroll, which causes problems for CodeMirror's scrollbars. CodeMirror's solution is to set a minimum size for their scrollbars, which is always present. The trade is that the container overlays most of the last line, swallowing click events when there is scrolling to do, even when no scrollbar is visible. This reverses the trade, recovering the click events at the expense of never showing the horizontal scrollbar on OS X when this option is enabled.

File last commit:

r18882:ba45bba5
r20298:2907e856
Show More
manager.js
45 lines | 1.7 KiB | application/javascript | JavascriptLexer
Jonathan Frederic
Clarified API for the create_model function,...
r18512 // Test the widget manager.
casper.notebook_test(function () {
var index;
this.then(function () {
// Check if the WidgetManager class is defined.
this.test.assert(this.evaluate(function() {
return IPython.WidgetManager !== undefined;
}), 'WidgetManager class is defined');
// Check if the widget manager has been instantiated.
this.test.assert(this.evaluate(function() {
return IPython.notebook.kernel.widget_manager !== undefined;
}), 'Notebook widget manager instantiated');
// Try creating a widget from Javascript.
Jonathan Frederic
Rebase fixes
r18517 this.evaluate(function() {
IPython.notebook.kernel.widget_manager.create_model({
model_name: 'WidgetModel',
Jonathan Frederic
Initial stab at adding promises to the widget framework.
r18882 widget_class: 'IPython.html.widgets.widget_int.IntSlider'})
.then(function(model) {
Jonathan Frederic
Rebase fixes
r18517 console.log('Create success!', model);
window.slider_id = model.id;
Jonathan Frederic
Initial stab at adding promises to the widget framework.
r18882 }, function(error) { console.log(error); });
Jonathan Frederic
Rebase fixes
r18517 });
});
// Wait for the state to be recieved.
this.waitFor(function check() {
return this.evaluate(function() {
return window.slider_id !== undefined;
Jonathan Frederic
Clarified API for the create_model function,...
r18512 });
});
index = this.append_cell(
'from IPython.html.widgets import Widget\n' +
Jonathan Frederic
Address some more review comments...
r18514 'widget = list(Widget.widgets.values())[0]\n' +
Jonathan Frederic
Clarified API for the create_model function,...
r18512 'print(widget.model_id)');
this.execute_cell_then(index, function(index) {
var output = this.get_output_cell(index).text.trim();
Jonathan Frederic
Rebase fixes
r18517 var slider_id = this.evaluate(function() { return window.slider_id; });
this.test.assertEquals(output, slider_id, "Widget created from the front-end.");
Jonathan Frederic
Clarified API for the create_model function,...
r18512 });
});