##// 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:

r20072:59f28a7f
r20298:2907e856
Show More
widget_output.js
64 lines | 2.0 KiB | application/javascript | JavascriptLexer
// Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
define([
"widgets/js/widget",
"jquery",
'notebook/js/outputarea',
], function(widget, $, outputarea) {
'use strict';
var OutputView = widget.DOMWidgetView.extend({
/**
* Public constructor
*/
initialize: function (parameters) {
OutputView.__super__.initialize.apply(this, [parameters]);
this.model.on('msg:custom', this._handle_route_msg, this);
},
/**
* Called when view is rendered.
*/
render: function(){
this.output_area = new outputarea.OutputArea({
selector: this.$el,
prompt_area: false,
events: this.model.widget_manager.notebook.events,
keyboard_manager: this.model.widget_manager.keyboard_manager });
// Make output area reactive.
var that = this;
this.output_area.element.on('changed', function() {
that.model.set('contents', that.output_area.element.html());
});
this.model.on('change:contents', function(){
var html = this.model.get('contents');
if (this.output_area.element.html() != html) {
this.output_area.element.html(html);
}
}, this);
// Set initial contents.
this.output_area.element.html(this.model.get('contents'));
},
/**
* Handles re-routed iopub messages.
*/
_handle_route_msg: function(msg) {
if (msg) {
var msg_type = msg.msg_type;
if (msg_type=='clear_output') {
this.output_area.handle_clear_output(msg);
} else {
this.output_area.handle_output(msg);
}
}
},
});
return {
'OutputView': OutputView,
};
});