Skip to content

Instantly share code, notes, and snippets.

@pduersteler
Created September 16, 2012 09:40
Show Gist options
  • Save pduersteler/3731777 to your computer and use it in GitHub Desktop.
Save pduersteler/3731777 to your computer and use it in GitHub Desktop.
$(function()
{
applyUiTo('body');
$('a[data-modal=true]').on('click', function(event)
{
$.get($(this).attr('href'), function(data) {
$(data).modal({
// No problem here because I have a selector
onShow: function(dialog) { applyUiTo('#simplemodal-container'); });
});
});
});
$('form').on('ajax:success', function(event, data)
{
// Problem here because the data is not yet inserted into the DOM
applyUiTo(data);
});
});
function applyUiTo(scope)
{
var scope = scope || 'body';
// Just one of many things here...
$(scope).find('.icon[title], .contains-tooltip[title]').tooltip();
// [snip]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment