forked from derbyjs/d-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
39 lines (36 loc) · 979 Bytes
/
index.js
File metadata and controls
39 lines (36 loc) · 979 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
36
37
38
39
var lessRoot = __dirname + '/node_modules/bootstrap/less/'
, config = {
ns: 'boot'
, filename: __filename
, scripts: {
dropdown: require('./dropdown')
, option: require('./dropdown/option')
, modal: require('./modal')
, nav: require('./nav')
, link: {}
, link_divider: {}
, link_header: {}
, tab_pane: {}
}
}
module.exports = boot
boot.decorate = 'derby'
function boot(derby, options) {
var outConfig = Object.create(config)
, styles, outStyles, i, len, style
if (options && 'styles' in options) {
styles = options.styles
if (typeof styles === 'string') styles = [styles]
if (Array.isArray(styles)) {
outStyles = []
for (i = 0, len = styles.length; i < len; i++) {
outStyles.push(lessRoot + styles[i])
}
}
} else {
outStyles = lessRoot + 'bootstrap'
}
outConfig.styles = outStyles
derby.createLibrary(outConfig, options)
return this
}