Made checkbox and togglebutton compatable with disabled property

This commit is contained in:
Jonathan Frederic 2013-10-30 22:44:23 +00:00
parent 9f3450448e
commit 68798d810d

View File

@ -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