-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPEP 23: Backbone.js Widgets #4374
Merged
Merged
Changes from all commits
Commits
Show all changes
474 commits
Select commit
Hold shift + click to select a range
428a8bf
- ModalView can now be docked and undocked
jdfreder 2cf5ad7
- Fixed CSS so it also applies to widgets within modals
jdfreder 108ab2b
Fab CSS
jdfreder 8160877
s/LabelView/HTMLView
jdfreder 09112f4
Added LatexView
jdfreder 73f786b
Remove uneccessary lines in String.js
jdfreder 36f8d83
Add ImageWidget
jdfreder c633979
Added float range widget tests
jdfreder 8995edf
Fixed flushed messages not getting sent with new 'method' message tag
jdfreder cc21fe3
Added float widget tests
jdfreder 7ea0c5b
Added ImageWidget tests
jdfreder b8242a9
Added int range and int widget tests.
jdfreder 6f24736
Fixed backbone event handling for accordion view
jdfreder 60d945e
Added multicontainer widget tests
jdfreder 0678a52
jshint widget.js
jdfreder 400ef7d
Partially implemented selection widget tests
jdfreder 6ba0bab
Removed js test utils commit and rebased with master.
jdfreder ab1a8d2
Added selection widget tests
jdfreder 4e15ad1
Added list modification test to selection widget.
jdfreder 69edada
Added StringWidget tests
jdfreder 8861e54
Added throttling test
jdfreder e86db29
Organized tests.
jdfreder 8af19c3
Removed button.close() test because it caused the test framework to hang
jdfreder c25f02e
jslint /widgets
jdfreder 57bb760
Fixed context of onclick callbacks selection widget views
jdfreder 20fe605
Fixed some spacing in widget.js
jdfreder 8245b9b
Removed comm dependency of widget model and view
jdfreder 5d84782
Moved base widget model and view into widgets/base.js
jdfreder a09d70a
renamed: widget.js -> widgetmanager.js
jdfreder e785146
Fix, require.js needs return of widget manager for other widgets
jdfreder 90f97b8
Made display_view a public method.
jdfreder 3f5f27b
Made widget model state update function public
jdfreder 577ee63
Fixed nonregistered model bug in wiget manager
jdfreder ab24918
Removed unused that from widget manager
jdfreder 45a7ef8
Added parent parameter to on_display callback
jdfreder 6135b20
Added event for widget construction
jdfreder 8ec7166
Decoupled Python Widget from Comm
jdfreder 318baad
Remove redundent _handle_close method
jdfreder 47fda15
s/display/created for display_view stuff
jdfreder c102908
Moved touch logic out of model into view.
jdfreder 6e353ea
Added require.js shims for underscore and backbone
jdfreder 81257c2
Display handler now supports full kwargs
jdfreder 9811ba7
Separate the display from the models on the python side, creating a B…
66c8209
Intermediate changes to javascript side of backbone widgets
a1d2451
Remove the automatic _children_attr and _children_lists_attr.
793dcac
Remove unused code and debugging statements
9a1f2d3
Change accordion to use a children attribute
af63861
Delete unnecessary check for comm object
e3803e4
Move all references to cells to the view objects.
4441be8
Make updates more granular for widgets
010861f
Store views in the models and store child views in the views
3925c2a
Delete the snapshot message handler
a20d81a
Note todos for widgets
8dc15ec
fix a handle_status handler
4a084cc
Fix visible attribute for the very first render
2a81271
Make sure containers transmit the children; take care of case where c…
c691a7b
log the error stack for a kernel javascript error message
49d1da2
Move some Widget class references to BaseWidget
46d68b6
General cleanup of base.js, including indentation fixes and adding vi…
0137755
Get the add/remove css classes working
e234b21
Live updates for children automatically change container views.
a5d454b
Fix the python side of the add/remove class functions to send custom …
0aa8d33
Example notebooks updated.
48132d8
Converted tabs to spaces
jdfreder ebf151f
Added `update_children` pattern to remaining parent widgets
jdfreder a1aa8a3
Revert 2853eb41 's changes to traitlets
jdfreder 14b278e
Fixed JS tests to reflect Jason's changes
jdfreder 313cb90
renamed: wigets_container.js -> widgets_container.js
jdfreder 250e4f8
Added ViewWidget
jdfreder 49568c8
Re-decoupled comm_id from widget models
jdfreder 72af074
Removed console.log, unused
jdfreder 48deda6
Further indentation cleanup
jdfreder 60a426d
Fixed indent of line 450
jdfreder 7eeebf9
Moved view widget into widget.py
jdfreder 43c7823
Fixed indentation in widgetmanager.js
jdfreder 3fb7c52
Added line to dump page html casperjs
jdfreder adcd464
Enabled IPython Server output for Travis debugging
jdfreder c9888ee
Fixed static_url call which is no longer optionally 1 param
jdfreder 14459cf
Revert "Added line to dump page html casperjs"
jdfreder 5f99aad
Revert "Enabled IPython Server output for Travis debugging"
jdfreder 239f408
deleted: wigets_container.js
jdfreder 10a25b0
Print cell output
jdfreder b8e7ee9
Output one more for debugging
jdfreder 61db77c
Remove debug print statements in container tests
jdfreder 4d3ff81
Fixed typo in model_id property
jdfreder 84c0d03
Add widget view options in creating child views
f32e48c
Make the widget keys property traverse the superclasses and accumulat…
2451833
Get rid of keys magic; make the keys very explicit
075fab9
Make widget keys have more explicit inheritance
5e611bf
s/comm_id/model_id (left over from before)
jdfreder 52963fb
Updated comm id comments in view to model id
jdfreder b60a6f9
Completely remove cell from model and view.
jdfreder 2105d1a
Missing view argument when recursively calling widgetmanager.callback…
jdfreder a1286a4
Renamed widget js files
jdfreder c1bdf44
Updated require.js references
jdfreder 032f65b
Removed ViewWidget
jdfreder b4e4da3
add/remove_class now can accept a list of classes
jdfreder 6aabc0c
s/Widget/DOMWidget s/BaseWidget/Widget
jdfreder 1d180d4
s/default_view_name/view_name
jdfreder 888af91
s/_handle_widget_constructed/_call_widget_constructed
jdfreder e141746
Removed sync_method parameter from backbone msg spec
jdfreder 9c567f4
Added callbacks method to view
jdfreder 5334cab
s/widget.js/init.js
jdfreder a165819
renamed: basic_widgets.js -> init.js
jdfreder 6dd1ffd
Remove first three lines of repr widgets
jdfreder e73528c
Fixed _send so it can open a comm if needed.
jdfreder 311bda4
Remove view_name from display
jdfreder b67870c
remove 3rd callback type from on_displayed
jdfreder dfb0eb9
Fixed comments for optional kwargs so they are redundant.
jdfreder f3f38c8
send_state only once for dict signature of set_css
jdfreder cf2d9c4
_model_types, _view_types, _models - and document what keys and value…
jdfreder ed3d721
move backbone sync outside the widget manager class
jdfreder 310f261
remove msg.content.data.view_name and corrosponding create_view param
jdfreder 9877ef3
remove on_create_widget and handle_create_widget callback
jdfreder 33de470
Added note in widget manager why Backbone.sync is there rather
jdfreder 17ae963
re-order handle custom msg and handle recieve state
jdfreder 6d7f1c7
handle_msg a display_model method.
jdfreder 742e09b
Added missing comma
jdfreder d43ea71
Add constructor comment for widget model.
jdfreder 4369d73
Update option-passing for creating child views.
d0e1f9e
this.updating should be a key specific lock
jdfreder 6fe7aad
s/BaseWidgetView/WidgetView and s/WidgetView/DOMWidgetView
jdfreder 37f98c1
un-nest options.options
jdfreder 592da7d
Removed get_kernel method.
jdfreder 25f40ff
remove length test add_class and remove_class
jdfreder 515cf55
make JS update comment more descriptive (english)
jdfreder 500d8a3
comment model.set, so we know that it triggers update on other views
jdfreder 4e85339
add locks to update everywhere by using options to pass this
jdfreder af3cb8e
toggle button, set $el to button (removing extra div)
jdfreder bdf9a53
add comment views are in *_range
jdfreder 9139587
document _keys function and rename to jquery_slider_keys
jdfreder 8d175cf
s/image_format/format
jdfreder 4139a38
s/flaot/float
jdfreder a8db290
remove .html('');
jdfreder 404faa0
renamed: ../static/notebook/js/widgets/widget_multicontainer.js ->…
jdfreder 10a84ac
Finished renaming Multicontainer to SelectionContainer
jdfreder f0c9c00
Implement a context manager as a property locking mechanism in Widget.
jdfreder 92f4bb5
Add a helper method that acts on the changes made to a list.
jdfreder 304e2e4
Add a comment that explains the notion of the default element
jdfreder 1e8bd2e
Use .apply for calling base with not proto-type.
jdfreder ecbe638
Many checks off the todo list, test fixes
jdfreder 27be0fb
remove unused imports
ivanov daa3b6a
fix typos
ivanov e5dbb96
Dev meeting widget review day 1
jdfreder d8f5efb
Dev meeting Jan 2014, widget review day 2
jdfreder f1c3742
sync=True isntead of a keys list
jdfreder 1da6d0e
Added sync= attr to DOMWidget
jdfreder bff850b
Added sync=True to all view name attrs
jdfreder a76124e
Everyone uses one model
jdfreder a8368df
1-to-1 widget / view mapping
jdfreder f795cc3
Renamed *range test files to match other widget files
jdfreder b6908b1
A lot of bug fixes...
jdfreder 597c46c
More fixes
jdfreder 5cd3303
Fixed *almost* all of the test-detected bugs
jdfreder e1fdcc9
Fix test for selection widgets
jdfreder ed52e82
Got containers and mutlicontainers working! Yay
jdfreder f8345e1
Fab CSS
jdfreder 071fae6
Fix rebase issues
jdfreder a57e02d
Make widget views work with new keyboard manager.
jdfreder be029cd
Update component submodule to point to master
jdfreder 0311a8c
s/Int/CInt s/Float/CFloat
jdfreder c04aab1
Remove O(N) cell by msg-id lookup
jdfreder 0acd418
Added value validation on Python side.
jdfreder 0e56b40
Change orientation to Enum
jdfreder 32716dc
More PEP8 changes
jdfreder bb79d34
containers and selectioncontainers now only allow one of any single c…
jdfreder af37dd3
Added PEP8 style comments to all of the JS code.
jdfreder b25d6b3
Halign dict colons
jdfreder 603e41a
Fix bug in all children containing views
jdfreder 2b9fe45
Make dropdown view DOM swap elements on update.
jdfreder 6d0b62e
Fix the cell reference in views
df4f733
make the saving to python a method of the model, called with callbacks
eea2b79
update example notebooks
bd1ba86
Pass the whole message into the widget manager display_view call
c3a0818
Delete unnecessary save
43cee97
Cherry pick of @jasongrout 's 2bc2f96.
jdfreder 94a5aed
Added support for multiple kernels.
jdfreder 676624e
Fixed widget_manager instance test.
jdfreder f9ac12e
Widget require.js fix
jdfreder 3527bb2
Repr style out for widgets
jdfreder c92edbc
Better implementation of widget _repr_ style display logic.
jdfreder 92e9682
Added a line that was accidently deleted during merge of 4e813c5
jdfreder 262451e
Use is to compare NotImplemented
jdfreder 4e813c5
Rewrite widget syncing
e15e352
Change the callback logic so the order makes more sense:
jdfreder a6ff4f4
Remove residual tabs
jdfreder ff01af6
Reorganized attrs in widget.py
jdfreder 63d2f7a
Added doc strings to properties in widget.py
jdfreder fc964e6
s/custom_content/content
jdfreder 07dc2a7
ict comprehension and list comprehension in pack/unpack widgets
jdfreder 585885a
Document in widget packing that vaues must be JSON-able.
jdfreder 70a076d
Added new CallbackDispatcher class
jdfreder 11ca541
Fixed name conflict with _property_lock
jdfreder b15593f
Remove todo in apply update
jdfreder 5f40d5d
'create' should be handled in sync
jdfreder c6b69b2
Prefer JQuery to Underscore
jdfreder 77e364d
Replace .html with .text everywhere possible
jdfreder 9d49e0e
Removed for () loops where necessary. Replaced with _.each
jdfreder 201886e
Explicitly return null if there aren't any results
jdfreder 07e2df5
- remove second line in create_child_view
jdfreder 1e0859f
Added some small comments to widget code
jdfreder a811539
Use CUnicode for width and height in ImageWidget
jdfreder 3644592
Create base widget classes
jdfreder 1b8ed2a
deleted: widget_float_range.py
jdfreder 2798de1
Move js *RangeWidget code into *Widget
jdfreder 19e4b58
deleted: widget_float_range.js
jdfreder 1d5afc3
Made tests reflect changes to widget naming scheme.
jdfreder 71765e9
deleted: widgets_float_range.js
jdfreder 25a9d02
s/ModalView/PopupView
jdfreder 094e02a
Fixed typo - else -> elif
jdfreder 442154d
Fixed some typos related to _.each loops
jdfreder ddb2afa
Fixed context errors and a couple of typos to get the tests working a…
jdfreder 6ceec8d
Fixed a couple more context typos
jdfreder a341ba2
Updated subcomponents
jdfreder 29cac5a
Fixed bug where views child to other views would not have cell inform…
jdfreder 287a0a7
Removed float widget bound tests,
jdfreder e952756
Adjusted throttling
jdfreder 2af96a6
Float widget views now inherit from int counterparts
jdfreder f3b6c24
Support multiple types in selection widget.
jdfreder 48fcdd1
Replace O(N^2) algorithm with a faster one.
jdfreder 53b368b
s/view_name/_view_name
jdfreder 719d9ac
Added code that removes the views when a model/widget is closed.
jdfreder 615ab9a
Updated widget tutorials 1-2
jdfreder eab8dac
Changed selection widget API to use labels list
jdfreder 6413603
Fixed type in container
jdfreder 4817003
Updated examples 3-6
jdfreder 91c7760
Callback dispatcher return callback value.
jdfreder e4f69ed
Fixed bug in selection widget tests.
jdfreder 796c0ed
Cleanup examples
jdfreder 86eac83
Removed Dialogs example, since PopupWidgets are available.
jdfreder 4c316a8
Moved keyboard_manager logic into a sep. function.
jdfreder 3c96e03
Fixed bug in throttling code.
jdfreder c70540b
Fixed some more example files (see list below)...
jdfreder 65caa63
Updated cell numbering in console example.
jdfreder fac8110
Prevent TextBox from blurring unless explicity by user.
jdfreder 9ab757f
Simplified variable inspector example
jdfreder c8996c4
Fixed bug that prevented popup widget from displaying
jdfreder 217ad48
Removed D3 and Widget Tester examples for now, until they are fixed..
jdfreder 4ebd115
review pass on widgetmanager.js
minrk de90ea1
quick review pass on javascript
minrk 9cf2bba
review pass on Python-side of widgets
minrk 6721e7f
catch NotImplementedError, not NotImplemented
minrk ce69b63
Document _ipython_display_ in custom display logic
minrk 85a0de3
first review pass on widget tests
minrk ae6ac19
review pass on widget examples
minrk 4c141af
Merge pull request #11 from minrk/widgets
jdfreder 27b06ff
Removed blame comment
jdfreder 42d6b44
Simplify get_msg_cell function of notebook.js
jdfreder 5ed9376
Renamed widgets...
jdfreder d661486
Fixed Accordion test broken by last commit
jdfreder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule components
updated
from 0972b5 to d15365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
//---------------------------------------------------------------------------- | ||
// Copyright (C) 2013 The IPython Development Team | ||
// | ||
// Distributed under the terms of the BSD License. The full license is in | ||
// the file COPYING, distributed as part of this software. | ||
//---------------------------------------------------------------------------- | ||
|
||
//============================================================================ | ||
// WidgetModel, WidgetView, and WidgetManager | ||
//============================================================================ | ||
/** | ||
* Base Widget classes | ||
* @module IPython | ||
* @namespace IPython | ||
* @submodule widget | ||
*/ | ||
|
||
(function () { | ||
"use strict"; | ||
|
||
// Use require.js 'define' method so that require.js is intelligent enough to | ||
// syncronously load everything within this file when it is being 'required' | ||
// elsewhere. | ||
define(["underscore", | ||
"backbone", | ||
], function (Underscore, Backbone) { | ||
|
||
//-------------------------------------------------------------------- | ||
// WidgetManager class | ||
//-------------------------------------------------------------------- | ||
var WidgetManager = function (comm_manager) { | ||
// Public constructor | ||
WidgetManager._managers.push(this); | ||
|
||
// Attach a comm manager to the | ||
this.comm_manager = comm_manager; | ||
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(model_type, model_name) { | ||
that.comm_manager.register_target(model_name, $.proxy(that._handle_comm_open, that)); | ||
}); | ||
}; | ||
|
||
//-------------------------------------------------------------------- | ||
// Class level | ||
//-------------------------------------------------------------------- | ||
WidgetManager._model_types = {}; /* Dictionary of model type names (target_name) and model types. */ | ||
WidgetManager._view_types = {}; /* Dictionary of view names and view types. */ | ||
WidgetManager._managers = []; /* List of widget managers */ | ||
|
||
WidgetManager.register_widget_model = function (model_name, model_type) { | ||
// Registers a widget model by name. | ||
WidgetManager._model_types[model_name] = model_type; | ||
|
||
// Register the widget with the comm manager. Make sure to pass this object's context | ||
// in so `this` works in the call back. | ||
_.each(WidgetManager._managers, function(instance, i) { | ||
if (instance.comm_manager !== null) { | ||
instance.comm_manager.register_target(model_name, $.proxy(instance._handle_comm_open, instance)); | ||
} | ||
}); | ||
}; | ||
|
||
WidgetManager.register_widget_view = function (view_name, view_type) { | ||
// Registers a widget view by name. | ||
WidgetManager._view_types[view_name] = view_type; | ||
}; | ||
|
||
//-------------------------------------------------------------------- | ||
// Instance level | ||
//-------------------------------------------------------------------- | ||
WidgetManager.prototype.display_view = function(msg, model) { | ||
// Displays a view for a particular model. | ||
var cell = this.get_msg_cell(msg.parent_header.msg_id); | ||
if (cell === null) { | ||
console.log("Could not determine where the display" + | ||
" message was from. Widget will not be displayed"); | ||
} else { | ||
var view = this.create_view(model, {cell: cell}); | ||
if (view === null) { | ||
console.error("View creation failed", model); | ||
} | ||
if (cell.widget_subarea) { | ||
|
||
cell.widget_area.show(); | ||
cell.widget_subarea.append(view.$el); | ||
} | ||
} | ||
}; | ||
|
||
WidgetManager.prototype.create_view = function(model, options, view) { | ||
// Creates a view for a particular model. | ||
var view_name = model.get('_view_name'); | ||
var ViewType = WidgetManager._view_types[view_name]; | ||
if (ViewType) { | ||
|
||
// If a view is passed into the method, use that view's cell as | ||
// the cell for the view that is created. | ||
options = options || {}; | ||
if (view !== undefined) { | ||
options.cell = view.options.cell; | ||
} | ||
|
||
// Create and render the view... | ||
var parameters = {model: model, options: options}; | ||
view = new ViewType(parameters); | ||
view.render(); | ||
model.views.push(view); | ||
model.on('destroy', view.remove, view); | ||
|
||
this._handle_new_view(view); | ||
return view; | ||
} | ||
return null; | ||
}; | ||
|
||
WidgetManager.prototype._handle_new_view = function (view) { | ||
// Called when a view has been created and rendered. | ||
|
||
// If the view has a well defined element, inform the keyboard | ||
// manager about the view's element, so as the element can | ||
// escape the dreaded command mode. | ||
if (view.$el) { | ||
IPython.keyboard_manager.register_events(view.$el); | ||
} | ||
}; | ||
|
||
WidgetManager.prototype.get_msg_cell = function (msg_id) { | ||
var cell = null; | ||
// First, check to see if the msg was triggered by cell execution. | ||
if (IPython.notebook) { | ||
cell = IPython.notebook.get_msg_cell(msg_id); | ||
} | ||
if (cell !== null) { | ||
return cell; | ||
} | ||
// Second, check to see if a get_cell callback was defined | ||
// for the message. get_cell callbacks are registered for | ||
// widget messages, so this block is actually checking to see if the | ||
// message was triggered by a widget. | ||
var kernel = this.comm_manager.kernel; | ||
if (kernel) { | ||
var callbacks = kernel.get_callbacks_for_msg(msg_id); | ||
if (callbacks && callbacks.iopub && | ||
callbacks.iopub.get_cell !== undefined) { | ||
return callbacks.iopub.get_cell(); | ||
} | ||
} | ||
|
||
// Not triggered by a cell or widget (no get_cell callback | ||
// exists). | ||
return null; | ||
}; | ||
|
||
WidgetManager.prototype.callbacks = function (view) { | ||
// callback handlers specific a view | ||
var callbacks = {}; | ||
if (view && view.options.cell) { | ||
|
||
// Try to get output handlers | ||
var cell = view.options.cell; | ||
var handle_output = null; | ||
var handle_clear_output = null; | ||
if (cell.output_area) { | ||
handle_output = $.proxy(cell.output_area.handle_output, cell.output_area); | ||
handle_clear_output = $.proxy(cell.output_area.handle_clear_output, cell.output_area); | ||
} | ||
|
||
// Create callback dict using what is known | ||
var that = this; | ||
callbacks = { | ||
iopub : { | ||
output : handle_output, | ||
clear_output : handle_clear_output, | ||
|
||
// Special function only registered by widget messages. | ||
// Allows us to get the cell for a message so we know | ||
// where to add widgets if the code requires it. | ||
get_cell : function () { | ||
return cell; | ||
}, | ||
}, | ||
}; | ||
} | ||
return callbacks; | ||
}; | ||
|
||
WidgetManager.prototype.get_model = function (model_id) { | ||
// Look-up a model instance by its id. | ||
var model = this._models[model_id]; | ||
if (model !== undefined && model.id == model_id) { | ||
return model; | ||
} | ||
return null; | ||
}; | ||
|
||
WidgetManager.prototype._handle_comm_open = function (comm, msg) { | ||
// Handle when a comm is opened. | ||
var model_id = comm.comm_id; | ||
var widget_type_name = msg.content.target_name; | ||
var widget_model = new WidgetManager._model_types[widget_type_name](this, model_id, comm); | ||
this._models[model_id] = widget_model; | ||
}; | ||
|
||
IPython.WidgetManager = WidgetManager; | ||
return IPython.WidgetManager; | ||
}); | ||
}()); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
function(_, Backbone)
, since we are actually using underscore via_
below. This might also be a problem in other files.