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')
|
.attr('type', 'checkbox')
|
||||||
.click(function(el) {
|
.click(function(el) {
|
||||||
that.user_invoked_update = true;
|
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.model.set('value', that.$checkbox.prop('checked'));
|
||||||
that.touch();
|
that.touch();
|
||||||
that.user_invoked_update = false;
|
that.user_invoked_update = false;
|
||||||
@ -116,6 +119,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
// Handles and validates user input.
|
// Handles and validates user input.
|
||||||
handleClick: function(e) {
|
handleClick: function(e) {
|
||||||
this.user_invoked_update = true;
|
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.model.set('value', ! $(e.target).hasClass('active'));
|
||||||
this.touch();
|
this.touch();
|
||||||
this.user_invoked_update = false;
|
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('data-parent', '#' + this.$el.attr('id'))
|
||||||
.attr('href', '#' + uuid)
|
.attr('href', '#' + uuid)
|
||||||
.click(function(evt){
|
.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.model.set("selected_index", index);
|
||||||
that.touch();
|
that.touch();
|
||||||
})
|
})
|
||||||
@ -194,6 +197,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
.html('Page ' + index)
|
.html('Page ' + index)
|
||||||
.appendTo(tab)
|
.appendTo(tab)
|
||||||
.click(function (e) {
|
.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.model.set("selected_index", index);
|
||||||
that.touch();
|
that.touch();
|
||||||
that.select_page(index);
|
that.select_page(index);
|
||||||
|
@ -104,6 +104,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
|
|
||||||
// Handle when a value is clicked.
|
// Handle when a value is clicked.
|
||||||
handle_click: function (e) {
|
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.model.set('value', $(e.target).html(), this);
|
||||||
this.touch();
|
this.touch();
|
||||||
},
|
},
|
||||||
@ -193,6 +196,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
|
|
||||||
// Handle when a value is clicked.
|
// Handle when a value is clicked.
|
||||||
handle_click: function (e) {
|
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.model.set('value', $(e.target).val(), this);
|
||||||
this.touch();
|
this.touch();
|
||||||
},
|
},
|
||||||
@ -277,6 +283,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
|
|
||||||
// Handle when a value is clicked.
|
// Handle when a value is clicked.
|
||||||
handle_click: function (e) {
|
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.model.set('value', $(e.target).html(), this);
|
||||||
this.touch();
|
this.touch();
|
||||||
},
|
},
|
||||||
@ -358,6 +367,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
|
|
||||||
// Handle when a value is clicked.
|
// Handle when a value is clicked.
|
||||||
handle_click: function (e) {
|
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.model.set('value', $(e.target).html(), this);
|
||||||
this.touch();
|
this.touch();
|
||||||
},
|
},
|
||||||
|
@ -124,6 +124,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
// Handles and validates user input.
|
// Handles and validates user input.
|
||||||
handleChanging: function(e) {
|
handleChanging: function(e) {
|
||||||
this.user_invoked_update = true;
|
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.model.set('value', e.target.value);
|
||||||
this.touch();
|
this.touch();
|
||||||
this.user_invoked_update = false;
|
this.user_invoked_update = false;
|
||||||
@ -180,6 +183,9 @@ define(["notebook/js/widgets/widget"], function(widget_manager){
|
|||||||
|
|
||||||
// Handles and validates user input.
|
// Handles and validates user input.
|
||||||
handleChanging: function(e) {
|
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.model.set('value', e.target.value);
|
||||||
this.touch();
|
this.touch();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user