templates
Advanced tools
Comparing version 0.14.2 to 0.14.3
13
index.js
@@ -124,2 +124,15 @@ /*! | ||
this.expose('Views'); | ||
// ensure that plugins are loaded onto collections | ||
// created after the plugins are registered | ||
this.on('use', function(fn, app) { | ||
if (!fn || fn._createRegistered) return; | ||
fn._createRegistered = true; | ||
for (var key in app.views) { | ||
if (app.views.hasOwnProperty(key)) { | ||
app[key].use(fn); | ||
} | ||
} | ||
}); | ||
}; | ||
@@ -126,0 +139,0 @@ |
@@ -75,2 +75,5 @@ 'use strict'; | ||
// setup listeners | ||
this.listen(this); | ||
// add constructors | ||
@@ -99,2 +102,21 @@ this.define('List', opts.List || require('./list')); | ||
/** | ||
* Built-in listeners | ||
*/ | ||
Views.prototype.listen = function(collection) { | ||
// ensure that plugins are loaded onto views | ||
// created after the plugins are registered | ||
this.on('use', function(fn) { | ||
if (!fn || fn._createRegistered) return; | ||
fn._createRegistered = true; | ||
for (var key in collection.views) { | ||
if (collection.views.hasOwnProperty(key)) { | ||
collection.views[key].use(fn); | ||
} | ||
} | ||
}); | ||
}; | ||
/** | ||
* Set a view on the collection. This is identical to [addView](#addView) | ||
@@ -101,0 +123,0 @@ * except `setView` does not emit an event for each view. |
{ | ||
"name": "templates", | ||
"description": "System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.", | ||
"version": "0.14.2", | ||
"version": "0.14.3", | ||
"homepage": "https://github.com/jonschlinkert/templates", | ||
@@ -29,3 +29,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"base-option": "^0.6.1", | ||
"base-plugins": "^0.4.3", | ||
"base-plugins": "^0.4.4", | ||
"clone": "^1.0.2", | ||
@@ -32,0 +32,0 @@ "clone-stats": "0.0.1", |
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
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
163179
3945
+ Addedgopd@1.1.0(transitive)
- Removedgopd@1.0.1(transitive)
Updatedbase-plugins@^0.4.4