From 52079c598a5503af6e00a1f4fa42cbbf034857c1 2014-09-15 22:38:29 From: Sylvain Corlay Date: 2014-09-15 22:38:29 Subject: [PATCH] Adding a comment and renaming on_bulk_change to on_change --- diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js index 9fe52eb..f8b31aa 100644 --- a/IPython/html/static/widgets/js/widget.js +++ b/IPython/html/static/widgets/js/widget.js @@ -266,7 +266,12 @@ define(["widgets/js/manager", } }, - on_bulk_change: function(keys, callback, context) { + on_change: function(keys, callback, context) { + // on_change(["key1", "key2"], foo, context) differs from + // on("change:key1 change:key2", foo, context). + // If the widget attributes key1 and key2 are both modified, + // the second form will result in foo being called twice + // while the first will call foo only once. this.on('change', function() { if (keys.some(this.hasChanged, this)) { callback.apply(context);