From c7bff1cb2baf44e18c9788039298ac3dbd734f6e 2014-01-16 10:56:03 From: Jonathan Frederic Date: 2014-01-16 10:56:03 Subject: [PATCH] Made checkbox and togglebutton compatable with disabled property --- diff --git a/IPython/html/static/notebook/js/widgets/bool.js b/IPython/html/static/notebook/js/widgets/bool.js index 60c3f33..dabe840 100644 --- a/IPython/html/static/notebook/js/widgets/bool.js +++ b/IPython/html/static/notebook/js/widgets/bool.js @@ -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