Skip to content

add modal with Template. #43

@abate

Description

@abate

I often find myself to add a modal view to a form. So I'm wondering if it would be in the scope of this package to add a new function along these lines :

Modal.showWithTemplate = (template,data,title) ->
  Modal.show("ModalTemplate",{template: template, data: data, title: title})

Where the template would be something like this :

<template name="ModalTemplate">
  <div id={{template}} class="modal fade">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          {{title}}
          <button type="button" class="close" data-dismiss="modal">
            <span aria-hidden="true">X</span> <span class="sr-only">{{_ "close"}}</span>
          </button>
        </div>
        <div class="modal-body">
          {{> Template.dynamic template=template data=data}}
        </div>
      </div>
    </div>
  </div>
</template>

This simple function would allow the reuse of a single template for many modals.
If you think this could be a worthy addition, and if you don't have time to do it yourself,
I'll be happy to prepare a PR .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions