Skip to content

Commit

Permalink
Yikes - we were adding JS files to the page every time the topbar rel…
Browse files Browse the repository at this point in the history
…oaded. That is obviously not needed
  • Loading branch information
slusarz committed Oct 9, 2013
1 parent 6daed21 commit 91918a7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions horde/js/topbar.js
Expand Up @@ -2,8 +2,10 @@
* Scripts for the Horde topbar.
*/
var HordeTopbar = {

// Vars used and defaulting to null/false:
// conf, searchGhost
jsfiles: $H(),

/**
* Updates the date in the sub bar.
Expand Down Expand Up @@ -42,8 +44,11 @@ var HordeTopbar = {

this._renderTree(r.nodes, r.root_nodes);
r.files.each(function(file) {
$$('head')[0].insert(new Element('script', { src: file }));
});
if (!this.jsfiles.get(file)) {
$$('head')[0].insert(new Element('script', { src: file }));
this.jsfiles.set(file, 1);
}
}.bind(this));
},

_renderTree: function(nodes, root_nodes)
Expand Down

0 comments on commit 91918a7

Please sign in to comment.