Socket
Socket
Sign inDemoInstall

ampersand-view

Package Overview
Dependencies
Maintainers
4
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-view - npm Package Compare versions

Comparing version 7.4.1 to 7.4.2

2

ampersand-view.js

@@ -311,3 +311,3 @@ /*$AMPERSAND_VERSION*/

if (parent) parent.replaceChild(newDom, this.el);
if (newDom.nodeName === '#document-fragment') throw new Error('Views can only have one root element.');
if (newDom.nodeName === '#document-fragment') throw new Error('Views can only have one root element, including comment nodes.');
this.el = newDom;

@@ -314,0 +314,0 @@ return this;

{
"name": "ampersand-view",
"description": "A smart base view for Backbone apps, to make it easy to bind collections and properties to the DOM.",
"version": "7.4.1",
"version": "7.4.2",
"author": "Henrik Joreteg <henrik@andyet.net>",

@@ -6,0 +6,0 @@ "browser": "./ampersand-view.js",

@@ -17,10 +17,2 @@ # ampersand-view

<!-- starthide -->
## Browser support
[![browser support](https://ci.testling.com/ampersandjs/ampersand-view.png)
](https://ci.testling.com/ampersandjs/ampersand-view)
<!-- endhide -->
## Install

@@ -265,3 +257,3 @@

If you want to extend the `initialize` function of a superclass instead of redefining it completely, you can
If you want to extend the `initialize` function of a superclass instead of redefining it completely, you can
explicitly call the `initialize` of the superclass at the right time:

@@ -295,3 +287,3 @@ ```

If you want to extend the `render` function of a superclass instead of redefining it completely, you can
If you want to extend the `render` function of a superclass instead of redefining it completely, you can
explicitly call the `render` of the superclass at the right time:

@@ -312,3 +304,3 @@ ```

* containerEl {Element | String} This can either be an actual DOM element or a CSS selector string such as `.container`. If a string is passed ampersand-view runs `this.query('YOUR STRING')` to try to grab the element that should contain the collection of views. If you don't supply a `containerEl` it will default to `this.el`.
* `viewOptions` {Object} [optional] Additional options
* `viewOptions` {Object} [optional] Additional options
* `viewOptions` {Object} Options object that will get passed to the `initialize` method of the individual item views.

@@ -407,3 +399,3 @@ * `filter` {Function} [optional] Function that will be used to determine if a model should be rendered in this collection view. It will get called with a model and you simply return `true` or `false`.

notes:
notes:
- It will also match agains the root element.

@@ -431,5 +423,5 @@ - It will return the root element if you pass `''` as the selector.

notes:
notes:
- It also works if you're using multiple space-separated hooks. So something like `<img data-hook="avatar user-image"/>` would still match for `queryByHook('avatar')`.
- It simply uses `.query()` under the hood. So `.queryByHook('avatar')` is equivalent to `.query('[data-hook~=avatar]')`
- It simply uses `.query()` under the hood. So `.queryByHook('avatar')` is equivalent to `.query('[data-hook~=avatar]')`
- It will also match to root elements.

@@ -494,3 +486,3 @@ - If no match is found it returns `undefined`.

Removes a view from the DOM, and calls `stopListening` to remove any bound events that the view has `listenTo`'d. This method also triggers a `remove` event on the view, allowing for listeners (or the view itself) to listen to it and do some action, like cleanup some other resources being used.
Removes a view from the DOM, and calls `stopListening` to remove any bound events that the view has `listenTo`'d. This method also triggers a `remove` event on the view, allowing for listeners (or the view itself) to listen to it and do some action, like cleanup some other resources being used.

@@ -497,0 +489,0 @@ ```javascript

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc