pass minified to initialize function

This commit is contained in:
Keegan
2016-02-09 17:20:37 -08:00
parent 6f182b7358
commit 146938abe5
3 changed files with 13 additions and 7 deletions
+8 -5
View File
@@ -1,11 +1,13 @@
'use strict';
var componentRegistry = require('./component-registry');
var _ = require('../vendor/minified/minified')._;
var HTML = require('../vendor/minified/minified').HTML;
var minified = require('../vendor/minified/minified');
var utils = require('../lib/utils');
var ClayEvents = require('./clay-events');
var _ = minified._;
var HTML = minified.HTML;
/**
* @extends ClayEvents
* @param {Clay~ConfigItem} config
@@ -33,7 +35,7 @@ function ClayItem(config) {
self.config = config;
/** @type {M} */
self.$element = HTML(_.formatHtml(_component.template, _templateData));
self.$element = HTML(_component.template.trim(), _templateData);
/** @type {M} */
self.$manipulatorTarget = self.$element.select('[data-manipulator-target]');
@@ -44,12 +46,13 @@ function ClayItem(config) {
}
/**
* Run the initializer if it exists.
* Run the initializer if it exists and attaches the css to the head.
* Passes minified as the first param
* @returns {ClayItem}
*/
self.initialize = function() {
if (typeof _component.initialize === 'function') {
_component.initialize.apply(self, arguments);
_component.initialize.call(self, minified);
}
return self;
};