dependency update
This commit is contained in:
@@ -8,14 +8,14 @@
|
||||
translation_params = {}
|
||||
if model = @get('model')
|
||||
translation_params = model.serialize() if model.serialize
|
||||
return new Ember.Handlebars.SafeString(tspan(@title_path, translation_params)) if @title_path
|
||||
return tspan(@title_path, translation_params).htmlSafe() if @title_path
|
||||
# return translated title_path if directly set by options
|
||||
return new Ember.Handlebars.SafeString(tspan(@get('modal_options.title_path'), translation_params)) if @get('modal_options.title_path')
|
||||
return tspan(@get('modal_options.title_path'), translation_params).htmlSafe() if @get('modal_options.title_path')
|
||||
# infer title path based on controller name App.modals.AddSectionController => add_section
|
||||
underscored = `this.constructor.toString().substr(11).replace(/Controller$/, '').underscore()`
|
||||
# find translated title or humanize the controller name
|
||||
if convention_translation = ttry("modal.#{underscored}.title", translation_params)
|
||||
new Ember.Handlebars.SafeString(tspan(@get("modal.#{underscored}.title"), translation_params))
|
||||
tspan(@get("modal.#{underscored}.title"), translation_params).htmlSafe()
|
||||
else
|
||||
underscored.capitalize().replace(/_/, ' ')
|
||||
).property('model.id')
|
||||
|
||||
Reference in New Issue
Block a user