npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ordered-collection-view

v1.0.6

Published

CollectionView manages a list of DOM elements using a Backbone.Collection - call orderDOMAccordingToCollection to synchronize the child elements of your view with options.collection. - Models that are in options.collection that do not correspond to di

Downloads

13

Readme

collection-view

CollectionView manages a list of DOM elements using a Backbone.Collection

  • call orderDOMAccordingToCollection to synchronize the child elements of your view with options.collection.
    • Models that are in options.collection that do not correspond to direct children of this.el are used to construct new views using options.construct and appended to this.el
    • Direct children of this.el that do not correspond to a model in options.collection are detached.
    • Direct children of in this.el are ordered according to the index of their corresponding model in this.collection. Re-ordering is performed in-place to minimize the commotion that the DOM is subjected to.
  • call orderCollectionAccordingToDOM to synchronize the elements in options.collection with the child elements of this.el.
    • Models in options.collection that are do not correspond to direct children of this.el are removed from options.collection.
    • Elements that are direct children of this.el, but do not correspond to a model in the collection are left alone.
    • The remaining models in the collection are sorted according to the order in which they appear relative to their siblings

options.collection - the collection that will be used to manage the list of elements in this.el options.construct - optional - the constructor that will be used to build the views that are attached to this.el. Defaults to simple-view options.constructOptions - optional - the options passed to options.construct when it is called. If it is a function, it is executed for each view that is constructed, with the current CollectionView as the context, and the model for the view as the first argument. options.subTagName - the type of element that will be managed by the colleciton. Defaults to DIV options.subTagClass - class(es) that will be added to the sub elements options.deferInitialAdd - optional - defer appending the initial set of views to this.el until after this deferred has been resolved options.progressive - optional - if true, will load items progressively as they are scrolled into view

##installation:

npm install --save collection-view

##usage:

const collectionView = require('collection-view');