corrade-nucleus-nucleons
/base/000_base/js/wm/wm.js |
@@ -40,6 +40,21 @@ |
|
// Load the nucleon. |
$.get('/' + nucleon + '/index.html', function(data) { |
// Select all new scripts that have to be inserted into the DOM. |
var nucleonScripts = []; |
$(data).find('script').each(function() { |
var src = $(this).attr('src'); |
if(src === undefined) |
return; |
nucleonScripts[src] = $(this).get(0); |
}); |
// Remove scripts from the nucleon if they are already added to the DOM. |
var nowScripts = $(document).find('script').each(function() { |
var src = $(this).attr('src'); |
if(nucleonScripts[src] === undefined) |
return; |
$(data).remove(nucleonScripts[src]); |
}); |
$(data).hide().appendTo('#window-manager-desktop').fadeIn(750); |
}).done(function(data) { |
// Change the nucleon icon back. |