Created
April 6, 2012 22:29
-
-
Save evansagge/2323566 to your computer and use it in GitHub Desktop.
Loading AJAX content into Twitter Bootstrap modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
$("*").on "click", "a[data-toggle=modal]", -> | |
target = $(@).attr('data-target') || $(@).attr('href') | |
// ajax-ified only when data-target or href is not an anchor | |
unless (/^#/).test(target) | |
$.get target, (html) -> $(html).modal() | |
false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment