Repository navigation
Releases
v1.1.1
Minor Patch
- Fixed an issue when adding the same options object to two different instances during initialization, if a
defaultsoption was defined for the instance prototype that returned an object, then the two resulting instances would both end up sharing the same resulting default object.
Here is an example of the bug:
// Define a Layout that applies defaults containing an object.
var MyLayout = BackboneLayout.extend({
defaults: function() {
return {shared: new SomeObject()}
}
})
// Now, define shared options
var options = {
'foo': 'bar'
}
// Finally, instantiate two instances of 'MyLayout', both sharing the same options object.
var layout1 = new MyLayout(options);
var layout2 = new MyLayout(options);
// They will both share the same 'shared' object
layout1.options.shared === layout2.options.shared;
>> trueThis will no longer happen. The two instances will now have separate instances of the shared object.
v1.1.0
And almost right away the project is updated to v1.1.0.
Well, mostly it's because I didn't like how the ViewManager's various "get" methods worked. So, here are the changes:
Feature changes
ViewManager.getViews()returns theBackbone.VieworLayoutrather than theManagedViewViewManager.getViewsByModel()similarly returns the actualLayoutViewManager.getManagedViews()has been added to return theManagedViews instead.
This breaks some backward compatibility but, since the project is in a pretty early production-ready state I'm going to just skirt the issue by updating the minor release number. Also... no one is using this but me yet :-)
v1.0.0
backbone-layout has been "production ready" for quite some time. The v1.0.0 release should have been done two or three releases ago. But, better late than never.
There are a few new features of note in the official v1.0.0 release:
New Features
- You can now look up views by their models via the
ViewManager.getViewsByModelmethod (see updated README) - A
unRegisterViewmethod has been added toBackboneLayout. It functions as a reverse of theregisterViewmethod. It will remove a specific view from the list of registered views and unbind it.
Minor refactors
- Tests now pass jshint
- Upgraded the required
Backboneversion to1.1.2in order to take advantage of the AMD loading provided by that update. - The
UMDdefinition is more robust now and takes advantage ofBackboneandUnderscore's AMD definitions. - General code cleanup and minor refactoring.