Content language picker now contains (if needed) Draft state to be consistent with the Publish dialog

This commit is contained in:
Robert
2018-04-30 16:23:32 +02:00
parent 92d88d5a4c
commit a4b24bf198
2 changed files with 15 additions and 3 deletions

View File

@@ -213,11 +213,15 @@ Use this directive to construct a header inside the main editor window.
scope.vm.currentVariant = "";
function onInit() {
setVariantDraftState(scope.variants);
setCurrentVariant(scope.variants);
setVariantStatusColor(scope.variants);
}
function setCurrentVariant(variants) {
setVariantDraftState(variants);
angular.forEach(variants, function (variant) {
if(variant.current) {
scope.vm.currentVariant = variant;
@@ -245,8 +249,16 @@ Use this directive to construct a header inside the main editor window.
});
}
scope.goBack = function() {
if(scope.onBack) {
function setVariantDraftState(variants) {
_.each(variants, function (variant) {
if (variant.isEdited === true && !variant.state.includes("Draft")) {
variant.state += ", Draft";
}
});
}
scope.goBack = function () {
if (scope.onBack) {
scope.onBack();
}
};

View File

@@ -1,7 +1,7 @@
(function () {
"use strict";
function PublishController($scope, eventsService) {
function PublishController($scope) {
var vm = this;
var variants = $scope.model.variants;