forked from aupac/ember-aupac-typeahead
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (27 loc) · 841 Bytes
/
index.js
File metadata and controls
35 lines (27 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* jshint node: true */
'use strict';
function mergeConfig(obj1,obj2){
var obj3 = {};
for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }
for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }
return obj3;
}
module.exports = {
name: 'ember-aupac-typeahead',
included : function included(app) {
this._super.included(app);
var defaults = {
includeCss: true,
includeTypeahead: true
};
var projectConfig = this.project.config(app.env);
var userConfig = projectConfig['ember-aupac-typeahead'] || defaults;
var config = mergeConfig(defaults, userConfig);
if(config.includeCss) {
app.import('vendor/aupac-typeahead.css');
}
if (config.includeTypeahead) {
app.import(app.bowerDirectory + '/typeahead.js/dist/typeahead.jquery.min.js');
}
}
};