simplify perfStats mithril code

This commit is contained in:
Thibault Duplessis 2015-12-26 17:15:13 +07:00
parent 3b1bdaf131
commit a57819c24a
3 changed files with 5 additions and 19 deletions

View file

@ -5,8 +5,7 @@
@embedJs {
$(function() {
LichessPerfStat(document.getElementById('perfStatContent'), {
data: @Html(toJson(data)),
i18n: {}
data: @Html(toJson(data))
});
});
}

View file

@ -1,8 +0,0 @@
var m = require('mithril');
module.exports = function(env) {
this.data = env.data;
console.log(this.data);
};

View file

@ -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;
};