mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Reapply isolated menu.js webhook changes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/** Masthead Collection **/
|
||||
define(['mvc/tours', 'layout/generic-nav-view'], function( Tours, GenericNav ) {
|
||||
define(['mvc/tours', 'layout/generic-nav-view', 'mvc/webhooks'], function( Tours, GenericNav, Webhooks ) {
|
||||
var Collection = Backbone.Collection.extend({
|
||||
model: Backbone.Model.extend({
|
||||
defaults: {
|
||||
@@ -107,6 +107,29 @@ var Collection = Backbone.Collection.extend({
|
||||
]
|
||||
});
|
||||
|
||||
//
|
||||
// Webhooks
|
||||
//
|
||||
Webhooks.add({
|
||||
url: 'api/webhooks/masthead/all',
|
||||
callback: function(webhooks) {
|
||||
$(document).ready(function() {
|
||||
$.each(webhooks.models, function(index, model) {
|
||||
var webhook = model.toJSON();
|
||||
if (webhook.activate) {
|
||||
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),
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
// Admin.
|
||||
//
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user