This will modalize content someday.
JavaScript Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
src
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile

README.md

#jquery.modalizer

Given some html

<div class="non-modal-page">
  <h2>Some Title</h2>
  <form>
    <input type="text" name="foo">
    <div class="actions">
      <input type="submit" value="Do It">
    </div>
  </form>
</div>

When I

$(".non-modal-page").modalize();

Then I get

<form>
  <div class="modal-header">
    <h2>Some Title</h2>
  </div>
  <div class="modal-body">
    <input type="text" name="foo">
  </div>
  <div class="modal-footer">
    <div class="actions">
      <input type="submit" value="Do It">
    </div>
  </div>
</form>

Huh? Why?

Because generally it's a good idea to make your modal interactions work outside of a modal dialog for stuff like testing or mobile views and you probably don't want to write 2 sets of markup depending on what context your content is displayed in. So this will take your normal markup and rearrange it into what your modal library bootstrap wants it in.

Usage

$.ajax(url,
  dataType: "html"

  success: (response) -> (
    modal.html($(response).modalize())
  )
)

Options

TODO

Development

bundle install
rake jasmine:ci