-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
41 lines (33 loc) · 1.18 KB
/
index.js
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
36
37
38
39
40
41
'use strict';
module.exports = {
name: require('./package').name,
included: function() {
this._super.included.apply(this, arguments);
let importTarget = this;
if (typeof this.import !== 'function') {
importTarget = this._findApp();
}
let prefix = 'node_modules/leaflet.fullscreen/';
importTarget.import(prefix + 'Control.FullScreen.js');
importTarget.import(prefix + 'Control.FullScreen.css');
importTarget.import(prefix + 'icon-fullscreen.png', { destDir: '/assets' });
importTarget.import(prefix + 'icon-fullscreen-2x.png', { destDir: '/assets' });
},
// taken from ember-fetch
_findApp() {
if (typeof this._findHost === 'function') {
return this._findHost();
} else {
// Otherwise, we'll use this implementation borrowed from the _findHost()
// method in ember-cli.
// Keep iterating upward until we don't have a grandparent.
// Has to do this grandparent check because at some point we hit the project.
let app;
let current = this;
do {
app = current.app || this;
} while (current.parent && current.parent.parent && (current = current.parent));
return app;
}
},
};