Skip to content

Commit

Permalink
Fix webhook access to masthead collection
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed May 9, 2017
1 parent adc6ce5 commit 4c86628
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
27 changes: 8 additions & 19 deletions client/galaxy/scripts/layout/menu.js
Expand Up @@ -8,6 +8,7 @@ var Collection = Backbone.Collection.extend({
}
}),
fetch: function( options ){
var self = this;
options = options || {};
this.reset();

Expand Down Expand Up @@ -117,25 +118,13 @@ var Collection = Backbone.Collection.extend({
$.each(webhooks.models, function(index, model) {
var webhook = model.toJSON();
if (webhook.activate) {
// Galaxy.page is undefined for data libraries, workflows pages
if( Galaxy.page ) {
Galaxy.page.masthead.collection.add({
id : webhook.name,
icon : webhook.config.icon,
url : webhook.config.url,
tooltip : webhook.config.tooltip,
onclick : webhook.config.function && new Function(webhook.config.function),
});
}
else if( Galaxy.masthead ) {
Galaxy.masthead.collection.add({
id : webhook.name,
icon : webhook.config.icon,
url : webhook.config.url,
tooltip : webhook.config.tooltip,
onclick : webhook.config.function && new Function(webhook.config.function),
});
}
self.add({
id : webhook.name,
icon : webhook.config.icon,
url : webhook.config.url,
tooltip : webhook.config.tooltip,
onclick : webhook.config.function && new Function(webhook.config.function),
});
}
});
});
Expand Down

0 comments on commit 4c86628

Please sign in to comment.