From d69e957b9a8c0639524070865e2b3f579473defa Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Tue, 3 Dec 2013 19:24:11 +0000 Subject: [PATCH] Added support for disabled flag to button widget. --- IPython/html/static/notebook/js/widgets/button.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IPython/html/static/notebook/js/widgets/button.js b/IPython/html/static/notebook/js/widgets/button.js index d45098405..e8bb0045c 100644 --- a/IPython/html/static/notebook/js/widgets/button.js +++ b/IPython/html/static/notebook/js/widgets/button.js @@ -42,6 +42,12 @@ define(["notebook/js/widget"], function(widget_manager){ this.$el.html(description); } + if (this.model.get('disabled')) { + this.$el.attr('disabled','disabled'); + } else { + this.$el.removeAttr('disabled'); + } + return IPython.WidgetView.prototype.update.call(this); },