Permalink
Browse files

properties template added

  • Loading branch information...
ilan ilan
ilan authored and ilan committed Mar 19, 2013
1 parent bbc5bc2 commit b76bfb433186c3b4ed47b0f492338ce50e7c1d8b
@@ -102,6 +102,10 @@ class jqapi.Entry
for arg in args # for every argument
if arg and arg.name
argsEl.append $(templates.argumentsItem(arg)) # build and append element from template
+ if arg.property
+ for prop in arg.property
+ argsEl.append $(templates.propertyItem(prop))
+
insertExamples: (examples, el) ->
examples = [examples] unless $.isArray(examples)
@@ -68,14 +68,35 @@ class jqapi.Templates
"""
argumentsItem: (arg) ->
+ argn = arg.name
+ if arg and arg.optional
+ argn = "[#{arg.name}]"
+
"""
<tr>
- <td class='name'>#{arg.name}</td>
+ <td class='name'>#{argn}</td>
<td class='type'>#{arg.type}</td>
<td class='desc'>#{arg.desc}</td>
</tr>
"""
+ propertyItem: (prop) ->
+ if prop.default?
+ prop.def = "(default: <em>#{prop.default}</em>)"
+ else
+ prop.def = ""
+
+ """
+ <tr class="property"><td colspan=3>
+ #{prop.name}
+ #{prop.def}
+ <br>
+ Type:
+ <a href="//api.jquery.com/Types##{prop.type}">#{prop.type}</a>
+ <p>#{prop.desc}</p>
+ </td></tr>
+ """
+
examplesItem: (example) ->
"""
<li class='example clearfix'>
@@ -259,4 +259,27 @@
color: #888
tr:nth-child(even)
- background: #e5edf9
+ background: #e5edf9
+
+ tr.property
+
+ td
+ color: pink
+
+ padding-left: 30px
+ background: rgb(34, 34, 34)
+
+ p
+ font-size: 1em
+ margin: 0
+ ul
+ padding-left: 30px
+
+ li::after
+ content: "\00a0"
+ display: block
+ border: 0
+ border-top: 1px dashed #ccc
+ line-height: 4px
+
+

0 comments on commit b76bfb4

Please sign in to comment.