How to use the @jupyter-widgets/controls.HTMLView function in @jupyter-widgets/controls

To help you get started, we’ve selected a few @jupyter-widgets/controls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Who8MyLunch / Jupyter_Video_Widget / js / src / jupyter-video.js View on Github external
defaults: _.extend(_.result(this, 'widgets.DOMWidgetModel.prototype.defaults'), {
        _model_name:          'VideoModel',
        _model_module:         module_name,
        _model_module_version: module_version,

        _view_name:          'VideoView',
        _view_module:         module_name,
        _view_module_version: module_version,
    })
});


//-----------------------------------------------

// Widget View renders the model to the DOM
var TimeCodeView = widgets_controls.HTMLView.extend({
    // https://codereview.stackexchange.com/questions/49524/updating-single-view-on-change-of-a-model-in-backbone
    render: function() {
        this.listenTo(this.model, 'change:timecode', this.timecode_changed);

        TimeCodeView.__super__.render.apply(this);

        this.timecode_changed();
        this.update();

        return this;
    },

    timecode_changed: function() {
        var time_base = this.model.get('timebase');

        var t = this.model.get('timecode');  //  current video time in seconds