mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Made checkbox and togglebutton compatable with disabled property
This commit is contained in:
parent
9f3450448e
commit
68798d810d
@ -34,6 +34,9 @@ require(["notebook/js/widget"], function(){
|
||||
if (!this.user_invoked_update) {
|
||||
this.$checkbox.prop('checked', this.model.get('value'));
|
||||
|
||||
var disabled = this.model.get('disabled');
|
||||
this.$checkbox.prop('disabled', disabled);
|
||||
|
||||
var description = this.model.get('description');
|
||||
if (description.length == 0) {
|
||||
this.$label.hide();
|
||||
@ -75,6 +78,9 @@ require(["notebook/js/widget"], function(){
|
||||
this.$button.removeClass('active');
|
||||
}
|
||||
|
||||
var disabled = this.model.get('disabled');
|
||||
this.$button.prop('disabled', disabled);
|
||||
|
||||
var description = this.model.get('description');
|
||||
if (description.length == 0) {
|
||||
this.$button.html(' '); // Preserve button height
|
||||
|
Loading…
Reference in New Issue
Block a user