-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcomponent.js
More file actions
28 lines (28 loc) · 805 Bytes
/
component.js
File metadata and controls
28 lines (28 loc) · 805 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
var Component = {
keygen: {
build: function(options) {
return {
$components: [
options.view.title(options.model.algorithm + " " + options.model.export)].concat(Component.keygen.keys(options))
}
},
keys: function(options) {
return {
$init: function() {
var self = this;
Model.generate[options.model.algorithm]().then(function(keys) {
Promise.all(options.model.export.map(function(exportItem) {
return Model.export(keys[exportItem])
}))
.then(function(exported_keys) {
self._refresh(exported_keys)
})
})
},
_refresh: function(items) {
this.$components = items.map(options.view.content)
}
}
}
}
}