diff --git a/IPython/html/static/notebook/js/widgetmanager.js b/IPython/html/static/notebook/js/widgetmanager.js index 80c4d11..c8a5fb5 100644 --- a/IPython/html/static/notebook/js/widgetmanager.js +++ b/IPython/html/static/notebook/js/widgetmanager.js @@ -37,8 +37,9 @@ this._models = {}; /* Dictionary of model ids and model instances */ // Register already-registered widget model types with the comm manager. + var that = this; _.each(WidgetManager._model_types, function(value, key) { - this.comm_manager.register_target(value, $.proxy(this._handle_comm_open, this)); + that.comm_manager.register_target(value, $.proxy(that._handle_comm_open, that)); }); }; diff --git a/IPython/html/static/notebook/js/widgets/widget_selection.js b/IPython/html/static/notebook/js/widgets/widget_selection.js index c95e34b..fab10c0 100644 --- a/IPython/html/static/notebook/js/widgets/widget_selection.js +++ b/IPython/html/static/notebook/js/widgets/widget_selection.js @@ -172,7 +172,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){ _.each(items, function(item, index) { if (item == value) { found = true; - break; + return false; } }); @@ -257,7 +257,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){ _.each(items, function(item, index) { if (item == value) { found = true; - break; + return false; } }); @@ -339,7 +339,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){ _.each(items, function(item, index) { if (item == value) { found = true; - break; + return false; } });