clean up old schedule publshing button code

This commit is contained in:
Mads Rasmussen
2018-10-05 11:15:21 +02:00
parent 41aa6e680e
commit 8eac3c5894
2 changed files with 0 additions and 42 deletions

View File

@@ -97,14 +97,6 @@
eventsService.unsubscribe(evts[e]);
}
evts.push(eventsService.on("editors.content.changePublishDate", function (event, args) {
createButtons(args.node);
}));
evts.push(eventsService.on("editors.content.changeUnpublishDate", function (event, args) {
createButtons(args.node);
}));
evts.push(eventsService.on("editors.documentType.saved", function (name, args) {
// if this content item uses the updated doc type we need to reload the content item
if (args && args.documentType && args.documentType.key === content.documentType.key) {

View File

@@ -266,40 +266,6 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
}
}
// If we have a scheduled publish or unpublish date change the default button to
// "save" and update the label to "save and schedule
if (args.content.releaseDate || args.content.removeDate) {
// if save button is alread the default don't change it just update the label
if (buttons.defaultButton && buttons.defaultButton.letter === "A") {
buttons.defaultButton.labelKey = "buttons_saveAndSchedule";
return buttons;
}
if (buttons.defaultButton && buttons.subButtons && buttons.subButtons.length > 0) {
// save a copy of the default so we can push it to the sub buttons later
var defaultButtonCopy = angular.copy(buttons.defaultButton);
var newSubButtons = [];
// if save button is not the default button - find it and make it the default
angular.forEach(buttons.subButtons, function (subButton) {
if (subButton.letter === "A") {
buttons.defaultButton = subButton;
buttons.defaultButton.labelKey = "buttons_saveAndSchedule";
} else {
newSubButtons.push(subButton);
}
});
// push old default button into subbuttons
newSubButtons.push(defaultButtonCopy);
buttons.subButtons = newSubButtons;
}
}
return buttons;
},