Skip to content

Commit

Permalink
New data-control-checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Javi Jimenez Villar committed Mar 12, 2013
1 parent 5523e16 commit 43592f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/boot/Lungo.Boot.Data.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ Lungo.Boot.Data = do(lng = Lungo) ->
el = lng.dom(children)
_bindDataAttribute el, el.data(key), attribute.html


_bindDataAttribute = (element, value, html) ->
html_binded = html.replace(BINDING.START + BINDING.KEY + BINDING.END, value)
element.prepend html_binded
element.prepend html.replace(/\{\{value\}\}/g, value)

init: init
7 changes: 7 additions & 0 deletions src/modules/Lungo.Attributes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Lungo.Attributes =
selector: "header"
html: "<span class=\"title centered\">{{value}}</span>"

"control-checkbox":
selector: "*"
html: """
<input type="checkbox" value="None" id="{{value}}" />
<label for="{{value}}"></label>
"""

loading:
selector: "*"
html: """
Expand Down

0 comments on commit 43592f7

Please sign in to comment.