mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
comment model.set, so we know that it triggers update on other views
This commit is contained in:
parent
ccbfcbc159
commit
c4edfdc828
@ -34,6 +34,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
.attr('type', 'checkbox')
|
||||
.click(function(el) {
|
||||
that.user_invoked_update = true;
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
that.model.set('value', that.$checkbox.prop('checked'));
|
||||
that.touch();
|
||||
that.user_invoked_update = false;
|
||||
@ -116,6 +119,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
// Handles and validates user input.
|
||||
handleClick: function(e) {
|
||||
this.user_invoked_update = true;
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
this.model.set('value', ! $(e.target).hasClass('active'));
|
||||
this.touch();
|
||||
this.user_invoked_update = false;
|
||||
|
@ -96,6 +96,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
.attr('data-parent', '#' + this.$el.attr('id'))
|
||||
.attr('href', '#' + uuid)
|
||||
.click(function(evt){
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
that.model.set("selected_index", index);
|
||||
that.touch();
|
||||
})
|
||||
@ -194,6 +197,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
.html('Page ' + index)
|
||||
.appendTo(tab)
|
||||
.click(function (e) {
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
that.model.set("selected_index", index);
|
||||
that.touch();
|
||||
that.select_page(index);
|
||||
|
@ -104,6 +104,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
|
||||
// Handle when a value is clicked.
|
||||
handle_click: function (e) {
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
this.model.set('value', $(e.target).html(), this);
|
||||
this.touch();
|
||||
},
|
||||
@ -193,6 +196,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
|
||||
// Handle when a value is clicked.
|
||||
handle_click: function (e) {
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
this.model.set('value', $(e.target).val(), this);
|
||||
this.touch();
|
||||
},
|
||||
@ -277,6 +283,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
|
||||
// Handle when a value is clicked.
|
||||
handle_click: function (e) {
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
this.model.set('value', $(e.target).html(), this);
|
||||
this.touch();
|
||||
},
|
||||
@ -358,6 +367,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
|
||||
// Handle when a value is clicked.
|
||||
handle_click: function (e) {
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
this.model.set('value', $(e.target).html(), this);
|
||||
this.touch();
|
||||
},
|
||||
|
@ -124,6 +124,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
// Handles and validates user input.
|
||||
handleChanging: function(e) {
|
||||
this.user_invoked_update = true;
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
this.model.set('value', e.target.value);
|
||||
this.touch();
|
||||
this.user_invoked_update = false;
|
||||
@ -180,6 +183,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
|
||||
// Handles and validates user input.
|
||||
handleChanging: function(e) {
|
||||
|
||||
// Calling model.set will trigger all of the other views of the
|
||||
// model to update.
|
||||
this.model.set('value', e.target.value);
|
||||
this.touch();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user