mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Fixed context of onclick callbacks selection widget views
This commit is contained in:
parent
4e3b2b3e94
commit
5678617d8f
@ -74,7 +74,7 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
var that = this;
|
||||
var item_button = $('<a href="#"/>')
|
||||
.html(items[index])
|
||||
.on('click', this.handle_click);
|
||||
.on('click', $.proxy(this.handle_click, this));
|
||||
this.$droplist.append($('<li />').append(item_button));
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
.addClass(this.model)
|
||||
.val(items[index])
|
||||
.prependTo($label)
|
||||
.on('click', this.handle_click);
|
||||
.on('click', $.proxy(this.handle_click, this));
|
||||
}
|
||||
|
||||
var $item_element = this.$container.find(item_query);
|
||||
@ -231,7 +231,7 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
.addClass('btn')
|
||||
.html(items[index])
|
||||
.appendTo(this.$buttongroup)
|
||||
.on('click', this.handle_click);
|
||||
.on('click', $.proxy(this.handle_click, this));
|
||||
}
|
||||
|
||||
var $item_element = this.$buttongroup.find(item_query);
|
||||
@ -311,7 +311,7 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
.html(items[index])
|
||||
.attr('value', items[index])
|
||||
.appendTo(this.$listbox)
|
||||
.on('click', this.handle_click);
|
||||
.on('click', $.proxy(this.handle_click, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user