Allow modal to hardwire partialName for inheritance default template behaviour

This commit is contained in:
2018-09-24 20:06:03 -05:00
parent 62002937a4
commit fb404e8f3e
+2 -2
View File
@@ -124,6 +124,7 @@ export default Ember.Mixin.create ApplicationRouteMixin,
# -edit-distribution-point
# modals/-edit-distribution-point
#
unless controller.get('partialName')
partialPath = null
while not partialPath and modalNameParts.length
if container.lookup "template:#{modalNameParts.join('/')}/-#{partialName}"
@@ -142,9 +143,8 @@ export default Ember.Mixin.create ApplicationRouteMixin,
console.log message
@set "router.globals.flash_message", message
return
@incrementProperty 'router.globals.modals_counter'
controller.set 'partialName', partialPath
@incrementProperty 'router.globals.modals_counter'
controller.willOpenModal() # can be implemented to setup stuff before rendering and hooks
@render 'modals/layout',
into: 'application'