Move HTML template array concatenation into its own function.

This commit is contained in:
ccd0 2015-03-28 16:11:34 -07:00
parent b2659b91dd
commit 9836d5ad07
2 changed files with 6 additions and 1 deletions

View File

@ -50,7 +50,7 @@ module.exports = (grunt) ->
parts.push switch part[1]
when '$' then "E(`#{part[2]}`)"
when '&' then "`#{part[2]}`.innerHTML"
when '@' then "`#{part[2]}`.map((x) -> x.innerHTML).join('')"
when '@' then "E.cat(`#{part[2]}`)"
when '?'
args = ['""', '""']
for i in [0...2]

View File

@ -14,3 +14,8 @@ E = do ->
fn = (x) ->
str[x]
(text) -> r.call text, regex, fn
E.cat = (templates) ->
html = ''
html += x.innerHTML for x in templates
html