src/joosy/core/helpers/view.coffee in joosy-1.2.0.alpha.38 vs src/joosy/core/helpers/view.coffee in joosy-1.2.0.alpha.41
- old
+ new
@@ -3,9 +3,21 @@
#
# Rendering and string representation helpers
#
Joosy.helpers 'Application', ->
+ #
+ # Generates HTML tag string
+ #
+ # @param [String] name Tag name
+ # @param [Object] options Tag attributes
+ # @param [String] content String content to inject
+ # @param [Function] content Function that will be evaluated and the result will be taken as a content
+ #
+ # Example
+ # != @tag 'div', {class: 'foo'}, =>
+ # != @tag 'hr'
+ #
@tag = (name, options={}, content='') ->
content = content() if Object.isFunction(content)
element = document.createElement name
temp = document.createElement 'div'