mithril-material
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -19,34 +19,7 @@ "use strict"; | ||
oninit: function oninit(vnode) { | ||
var self = this; | ||
this.vnode = vnode; | ||
this.rows = vnode.attrs.rows; | ||
this.columns = vnode.attrs.columns; | ||
for (var i = 0; i < this.rows.length; i++) { | ||
if (self.rows[i]._selected == true) {} else { | ||
self.rows[i]._selected = false; | ||
} | ||
} | ||
}, | ||
selectSingleRow: function selectSingleRow(row, value) { | ||
row._selected = value; | ||
this.vnode.attrs.onselect && this.vnode.attrs.onselect([row]); | ||
}, | ||
selectAll: function selectAll(state) { | ||
var self = this; | ||
for (var i = 0; i < self.rows.length; i++) { | ||
self.rows[i]._selected = state; | ||
} | ||
this.vnode.attrs.onselect && this.vnode.attrs.onselect(self.rows.filter(function (row) { | ||
return row._selected == true; | ||
})); | ||
}, | ||
view: function view(vnode) { | ||
@@ -63,15 +36,2 @@ var self = this; | ||
null, | ||
(0, _mithril2.default)( | ||
"th", | ||
null, | ||
(0, _mithril2.default)( | ||
"span", | ||
null, | ||
(0, _mithril2.default)("input", { | ||
id: "check-all", | ||
type: "checkbox", | ||
onchange: self.selectAll.bind(self) }), | ||
(0, _mithril2.default)("label", { "for": "check-all" }) | ||
) | ||
), | ||
self.columns.map(function (column) { | ||
@@ -100,17 +60,2 @@ | ||
null, | ||
(0, _mithril2.default)( | ||
"td", | ||
null, | ||
(0, _mithril2.default)( | ||
"span", | ||
null, | ||
(0, _mithril2.default)("input", { | ||
id: row.id, | ||
key: row.id, | ||
type: "checkbox", | ||
onchange: self.selectSingleRow.bind(self, row), | ||
checked: row._selected }), | ||
(0, _mithril2.default)("label", { "for": row.id }) | ||
) | ||
), | ||
self.columns.map(function (column) { | ||
@@ -117,0 +62,0 @@ return (0, _mithril2.default)( |
{ | ||
"name": "mithril-material", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Material Design components for MithrilJs Applications", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
80850
888