all repos — litestore @ 0fad50ca4490503b87b5ecd0cc9a4929b39d5fb7

A minimalist nosql document store.

Minor widget refactoring.
h3rald h3rald@h3rald.com
Tue, 12 May 2015 18:59:15 +0200
commit

0fad50ca4490503b87b5ecd0cc9a4929b39d5fb7

parent

3fc94aee2c1c1a2d7f098608b609682d3801a2b9

2 files changed, 5 insertions(+), 10 deletions(-)

jump to
M admin/js/components/widgets.jsadmin/js/components/widgets.js

@@ -165,15 +165,9 @@

// TagButton (warning: API change!) app.widgets.tagbutton = function(obj) { var tagbutton = { - controller: function(args){ - return { - name: args.tag, - n: args.n - }; - }, - view: function(ctrl) { - return m("a", {href: "/tags/"+ctrl.tag, config:m.route}, - [m("i.fa.fa-tag"), " "+ctrl.name+" ", m("span.badge", ctrl.n)]); + view: function(ctrl, args) { + return m("a", {href: "/tags/"+args.name, config:m.route}, + [m("i.fa.fa-tag"), " "+args.name+" ", m("span.badge", args.n)]); } }; return m.component(tagbutton, obj);
M admin/js/modules/info.jsadmin/js/modules/info.js

@@ -29,7 +29,8 @@ ])]);

var logo = m(".col-sm-6", [m("img", {src: "images/litestore.png"})]); var taglist = m("ul.list-unstyled", info.tags.map(function(tag){ var key = Object.keys(tag)[0]; - return m("li", [w.tagbutton({tag: key, n: tag[key], key: u.guid()})]); + console.log(key); + return m("li", [w.tagbutton({name: key, n: tag[key], key: u.guid()})]); }) ); var v = m(".row", [