simplify perfStats mithril code
This commit is contained in:
parent
3b1bdaf131
commit
a57819c24a
|
@ -5,8 +5,7 @@
|
|||
@embedJs {
|
||||
$(function() {
|
||||
LichessPerfStat(document.getElementById('perfStatContent'), {
|
||||
data: @Html(toJson(data)),
|
||||
i18n: {}
|
||||
data: @Html(toJson(data))
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
var m = require('mithril');
|
||||
|
||||
module.exports = function(env) {
|
||||
|
||||
this.data = env.data;
|
||||
|
||||
console.log(this.data);
|
||||
};
|
|
@ -1,18 +1,13 @@
|
|||
var m = require('mithril');
|
||||
|
||||
var ctrl = require('./ctrl');
|
||||
var view = require('./view');
|
||||
|
||||
module.exports = function(element, opts) {
|
||||
|
||||
var controller = new ctrl(opts, element);
|
||||
|
||||
m.module(element, {
|
||||
controller: function() {
|
||||
return controller;
|
||||
return {
|
||||
data: opts.data
|
||||
};
|
||||
},
|
||||
view: view
|
||||
view: require('./view')
|
||||
});
|
||||
|
||||
return controller;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue