From 68798d810d9e1d1f23e5c2614256859cde6647f0 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Wed, 30 Oct 2013 22:44:23 +0000 Subject: [PATCH] Made checkbox and togglebutton compatable with disabled property --- IPython/html/static/notebook/js/widgets/bool.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IPython/html/static/notebook/js/widgets/bool.js b/IPython/html/static/notebook/js/widgets/bool.js index 60c3f33a6..dabe840c5 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