forked from yahoo/ember-gridstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
63 lines (51 loc) · 2.04 KB
/
index.js
File metadata and controls
63 lines (51 loc) · 2.04 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* jshint node: true */
'use strict';
module.exports = {
name: 'ember-gridstack',
included: function(app) {
this._super.included(app);
// lodash
app.import({
development: app.bowerDirectory + '/lodash/lodash.js',
production: app.bowerDirectory + '/lodash/dist/lodash.min.js'
});
// jquery-ui dependencies needed by gridstack.js
// https://github.com/gridstack/gridstack.js/blob/v0.2.6/src/gridstack.js#L10
[ 'version', 'data', 'disable-selection', 'focusable', 'escape-selector', 'form',
'ie', 'keycode', 'labels', 'jquery-1-7', 'plugin', 'safe-active-element',
'safe-blur', 'scroll-parent', 'tabbable', 'unique-id', 'widget'
].forEach(function(module) {
app.import({
development: app.bowerDirectory + '/jquery-ui/ui/' + module + '.js',
production: app.bowerDirectory + '/jquery-ui/ui/minified/' + module + '.min.js'
});
});
[ 'mouse', 'draggable', 'droppable', 'resizable' ].forEach(function(module) {
app.import({
development: app.bowerDirectory + '/jquery-ui/ui/widgets/' + module + '.js',
production: app.bowerDirectory + '/jquery-ui/ui/widgets/minified/' + module + '.min.js'
});
});
let config = this.getOptions();
if (config.exclude.indexOf('jquery.ui.touch-punch') < 0) {
app.import({
development: app.bowerDirectory + '/jquery.ui.touch-punch/dist/jquery.ui.touch-punch.js',
production: app.bowerDirectory + '/jquery.ui.touch-punch/dist/jquery.ui.touch-punch.min.js'
});
}
// Gridstack
app.import({
development: app.bowerDirectory + '/gridstack/dist/gridstack.js',
production: app.bowerDirectory + '/gridstack/dist/gridstack.min.js'
});
app.import(app.bowerDirectory + '/gridstack/dist/gridstack.css');
},
getOptions() {
let projectConfig = (this.project.config(process.env.EMBER_ENV) || {})['ember-gridstack'] || {};
let config = Object.assign({}, {
exclude: [],
}, projectConfig);
config.exclude = config.exclude || [];
return config;
}
};