Reapply isolated menu.js webhook changes

This commit is contained in:
Dannon Baker
2016-10-27 12:35:36 +02:00
parent 6e4f3d9d2d
commit 62773a72c7
7 changed files with 52 additions and 29 deletions
+24 -1
View File
@@ -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