New template button creates new template for broadcast services

This commit is contained in:
Pea Tyczynska
2020-08-10 18:14:36 +01:00
parent bf5ccd044b
commit bdfc0adcc0
2 changed files with 10 additions and 4 deletions

View File

@@ -153,13 +153,19 @@
return changed;
};
this.$broadcastService = (document.querySelector('div[id=add_new_template_form]')).getAttribute("data-broadcast")
this.actionButtonClicked = function(event) {
event.preventDefault();
this.currentState = $(event.currentTarget).val();
if (this.stateChanged()) {
this.render();
}
if (event.currentTarget.value === 'add-new-template' && this.$broadcastService) {
return window.location = "/services/" + this.$broadcastService + "/templates/add-broadcast";
} else {
if (this.stateChanged()) {
this.render();
};
};
};
this.selectionStatus = {