Skip to content

Commit

Permalink
Use jquery getScript & use fallbacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
markosullivan authored and tburry committed May 17, 2012
1 parent 14cceaf commit dcbcd5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -13,7 +13,7 @@
*/ */


define('APPLICATION', 'Vanilla'); define('APPLICATION', 'Vanilla');
define('APPLICATION_VERSION', '2.1a16'); define('APPLICATION_VERSION', '2.1a17');


// Report and track all errors. // Report and track all errors.
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR); error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR);
Expand Down
11 changes: 5 additions & 6 deletions js/embed.js
Expand Up @@ -249,13 +249,12 @@ window.vanilla.embed = function(host) {
if (container) { if (container) {
// If jQuery is present in the page, include our defer-until-visible script // If jQuery is present in the page, include our defer-until-visible script
if (typeof jQuery != 'undefined') { if (typeof jQuery != 'undefined') {
var vanillaLazyLoad = document.createElement('script');
vanillaLazyLoad.type = 'text/javascript';
vanillaLazyLoad.src = vanilla_forum_url + '/js/library/jquery.appear.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(vanillaLazyLoad);
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
$('#vanilla-comments').appear(function() { $.getScript('http://cdn.vanillaforums.com/js/jquery.appear.js', function() {
container.appendChild(vanillaIframe); if ($.fn.appear)
$('#vanilla-comments').appear(function() {container.appendChild(vanillaIframe);});
else
container.appendChild(vanillaIframe); // fallback
}); });
}); });
} else { } else {
Expand Down

0 comments on commit dcbcd5b

Please sign in to comment.