Modal refactor
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
helpers: <%= I18n.t('helpers', locale: :nl).to_json %>
|
||||
pagination: <%= I18n.t('views.pagination', locale: :nl).to_json %>
|
||||
errors: <%= I18n.t('errors', locale: :nl).to_json %>
|
||||
@ttry = (path, vars={})->
|
||||
@t(path, $.extend(vars, emptyWhenNotFound: true))
|
||||
|
||||
@t = (path, vars={}) ->
|
||||
#result = undefined
|
||||
#m = undefined
|
||||
@@ -24,6 +27,7 @@
|
||||
result = result[part] for part in parts
|
||||
catch err
|
||||
result = parts[parts.length - 1].capitalize()
|
||||
result = if vars.emptyWhenNotFound then "" else parts[parts.length - 1].capitalize()
|
||||
return "" if result is ""
|
||||
return parts[parts.length - 1].capitalize() unless result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user