corrade-nucleus-nucleons – Diff between revs 34 and 35

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 34 Rev 35
Line 44... Line 44...
44 var nucleonScripts = []; 44 var nucleonScripts = [];
45 $(data).find('script').each(function() { 45 $(data).find('script').each(function() {
46 var src = $(this).attr('src'); 46 var src = $(this).attr('src');
47 if(src === undefined) 47 if(src === undefined)
48 return; 48 return;
49 nucleonScripts[src] = $(this).get(0); 49 nucleonScripts[src] = $(this);
50 }); 50 });
51 // Remove scripts from the nucleon if they are already added to the DOM. 51 // Remove scripts from the nucleon if they are already added to the DOM.
52 var nowScripts = $(document).find('script').each(function() { 52 var nowScripts = $(document).find('script').each(function() {
53 var src = $(this).attr('src'); 53 var src = $(this).attr('src');
54 if(nucleonScripts[src] === undefined) 54 if(nucleonScripts[src] === undefined)
55 return; 55 return;
56 alert(nucleonScripts[src]); 56 nucleonScripts[src].remove();
57 $(data).remove(nucleonScripts[src]); -  
58 }); 57 });
59 $(data).hide().appendTo('#window-manager-desktop').fadeIn(750); 58 $(data).hide().appendTo('#window-manager-desktop').fadeIn(750);
60 }).done(function(data) { 59 }).done(function(data) {
61 // Change the nucleon icon back. 60 // Change the nucleon icon back.
62 $('#' + nucleon + '-window-manager-button-icon').attr('src', '/' + nucleon + '/img/' + nucleon + '.png'); 61 $('#' + nucleon + '-window-manager-button-icon').attr('src', '/' + nucleon + '/img/' + nucleon + '.png');