Created
September 16, 2012 09:40
-
-
Save pduersteler/3731777 to your computer and use it in GitHub Desktop.
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
$(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