Copied starter Meteor App files.
Cut and paste of the BasicMeteorApp.
This commit is contained in:
19
imports/util/polyfills/blaze.js
Normal file
19
imports/util/polyfills/blaze.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Get the parent template instance.
|
||||
* @param {Number} [levels] How many levels to go up. Default is 1
|
||||
* @returns {Blaze.TemplateInstance}
|
||||
*/
|
||||
Blaze.TemplateInstance.prototype.parentTemplate = Blaze.TemplateInstance.prototype.parentInstance = function(levels) {
|
||||
let view = this.view;
|
||||
|
||||
levels = (typeof levels === "undefined") ? 1 : levels;
|
||||
|
||||
while(view) {
|
||||
//if(view.name.substring(0, 9) === "Template." && !(levels--)) {
|
||||
if(view.template && !(levels--)) {
|
||||
//return view.templateInstance();
|
||||
return view.templateInstance();
|
||||
}
|
||||
view = view.parentView;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user