ampersand-view
Advanced tools
Comparing version 6.0.8 to 6.0.9
@@ -252,3 +252,3 @@ var State = require('ampersand-state'); | ||
var opts = { | ||
selector: subview.container || '[role=' + subview.role + ']', | ||
selector: subview.container || '[role="' + subview.role + '"]', | ||
waitFor: subview.waitFor || '', | ||
@@ -255,0 +255,0 @@ prepareView: subview.prepareView || function (el) { |
{ | ||
"name": "ampersand-view", | ||
"description": "A smart base view for Backbone apps, to make it easy to bind collections and properties to the DOM.", | ||
"version": "6.0.8", | ||
"version": "6.0.9", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "browser": "./ampersand-view.js", |
@@ -76,5 +76,5 @@ # ampersand-view | ||
The `.autoRender` property lets you optionally specify that the view should just automatically render with all the defaults. This requires that you at minimum specify a [template](#template) string of function. | ||
The `.autoRender` property lets you optionally specify that the view should just automatically render with all the defaults. This requires that you at minimum specify a [template](#template) string or function. | ||
By setting `autoRender: true` the view will simply call `.renderWithTemplate` for you (after your `initialize` method if present). So for simple views, if you've got a few bindings and a template your whole view could just be really and declarative like this: | ||
By setting `autoRender: true` the view will simply call `.renderWithTemplate` for you (after your `initialize` method if present). So for simple views, if you've got a few bindings and a template your whole view could just be really declarative like this: | ||
@@ -221,3 +221,3 @@ ```javascript | ||
* Attaches the following options directly to the instaniated view, overriding the defaults: `model`, `collection`, `el`. | ||
* Attaches the following options directly to the instantiated view, overriding the defaults: `model`, `collection`, `el`. | ||
* Sets up event bindings defined in the `events` hash. | ||
@@ -461,3 +461,3 @@ * Sets up the model bindings defined in the `bindings` hash. | ||
You can declare subviews that you want to render within a view, much like you would bindings. Useful for cases where the data you need for a subview may not be available on first render. Also, simplifies cases wehre you have lots of subviews. | ||
You can declare subviews that you want to render within a view, much like you would bindings. Useful for cases where the data you need for a subview may not be available on first render. Also, simplifies cases where you have lots of subviews. | ||
@@ -464,0 +464,0 @@ When the parent view is removed the `remove` method of all subviews will be called as well. |
@@ -554,2 +554,24 @@ var test = require('tape'); | ||
test('subview role can include special characters', function (t) { | ||
var Sub = AmpersandView.extend({ | ||
template: '<span></span>' | ||
}); | ||
var View = AmpersandView.extend({ | ||
template: '<div><div role="test.hi-there"></div></div>', | ||
autoRender: true, | ||
subviews: { | ||
sub1: { | ||
role: 'test.hi-there', | ||
constructor: Sub | ||
} | ||
} | ||
}); | ||
var view = new View(); | ||
t.equal(view.el.innerHTML, '<span></span>'); | ||
t.end(); | ||
}); | ||
test('make sure subviews dont fire until their `waitFor` is done', function (t) { | ||
@@ -556,0 +578,0 @@ var Sub = AmpersandView.extend({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59510
1089
1