diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js
index e26f622d2e..1d52c4e451 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js
@@ -65,6 +65,8 @@ Use this directive to render an umbraco button. The directive can be used to gen
@param {string=} icon Set a button icon.
@param {string=} size Set a button icon ("xs", "m", "l", "xl").
@param {boolean=} disabled Set to true to disable the button.
+@param {string=} addEllipsis Adds an ellipsis character (…) to the button label which means the button will open a dialog or prompt the user for more information.
+
**/
(function () {
@@ -90,14 +92,15 @@ Use this directive to render an umbraco button. The directive can be used to gen
icon: "@?",
disabled: "",
size: "@?",
- alias: "@?"
+ alias: "@?",
+ addEllipsis: "@?"
}
});
//TODO: This doesn't seem necessary?
- UmbButtonController.$inject = ['$timeout'];
+ UmbButtonController.$inject = ['$timeout', 'localizationService'];
- function UmbButtonController($timeout) {
+ function UmbButtonController($timeout, localizationService) {
var vm = this;
@@ -111,6 +114,8 @@ Use this directive to render an umbraco button. The directive can be used to gen
vm.style = null;
vm.innerState = "init";
+ vm.buttonLabel = vm.label;
+
if (vm.buttonStyle) {
// make it possible to pass in multiple styles
@@ -138,6 +143,8 @@ Use this directive to render an umbraco button. The directive can be used to gen
}
+ setButtonLabel();
+
}
function onChanges(changes) {
@@ -161,6 +168,18 @@ Use this directive to render an umbraco button. The directive can be used to gen
vm.disabled = changes.disabled.currentValue;
}
}
+
+ // watch for label changes
+ if(changes.label && changes.label.currentValue) {
+ vm.buttonLabel = changes.label.currentValue;
+ setButtonLabel();
+ }
+
+ // watch for label key changes
+ if(changes.labelKey && changes.labelKey.currentValue) {
+ setButtonLabel();
+ }
+
}
function clickButton(event) {
@@ -169,6 +188,24 @@ Use this directive to render an umbraco button. The directive can be used to gen
}
}
+ function setButtonLabel() {
+ // if the button opens a dialog add "..." to the label
+ if(vm.addEllipsis === "true") {
+ vm.buttonLabel = vm.buttonLabel + "...";
+ }
+
+ // look up localization key
+ if(vm.labelKey) {
+ localizationService.localize(vm.labelKey).then(function(value){
+ vm.buttonLabel = value;
+ // if the button opens a dialog add "..." to the label
+ if(vm.addEllipsis === "true") {
+ vm.buttonLabel = vm.buttonLabel + "...";
+ }
+ });
+ }
+ }
+
}
})();
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
index dbebf840f1..b7ddc28dca 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
@@ -372,7 +372,34 @@
};
$scope.sendToPublish = function () {
- return performSave({ saveMethod: contentResource.sendToPublish, action: "sendToPublish" });
+ clearNotifications($scope.content);
+ if (showSaveOrPublishDialog()) {
+ //before we launch the dialog we want to execute all client side validations first
+ if (formHelper.submitForm({ scope: $scope, action: "publish" })) {
+
+ var dialog = {
+ parentScope: $scope,
+ view: "views/content/overlays/sendtopublish.html",
+ variants: $scope.content.variants, //set a model property for the dialog
+ skipFormValidation: true, //when submitting the overlay form, skip any client side validation
+ submitButtonLabel: "Send for approval",
+ submit: function (model) {
+ model.submitButtonState = "busy";
+ clearNotifications($scope.content);
+ //we need to return this promise so that the dialog can handle the result and wire up the validation response
+ console.log("saving need to happen here");
+ },
+ close: function () {
+ overlayService.close();
+ }
+ };
+
+ overlayService.open(dialog);
+ }
+ }
+ else {
+ return performSave({ saveMethod: contentResource.sendToPublish, action: "sendToPublish" });
+ }
};
$scope.saveAndPublish = function () {
@@ -412,7 +439,7 @@
return $q.when(err);
});
},
- close: function (oldModel) {
+ close: function () {
overlayService.close();
}
};
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js
index 6e6b0f3c0f..decbd74150 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js
@@ -161,11 +161,12 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
//publish action
return {
letter: ch,
- labelKey: args.content.variants && args.content.variants.length > 1 ? "buttons_saveAndPublishMany" : "buttons_saveAndPublish",
+ labelKey: "buttons_saveAndPublish",
handler: args.methods.saveAndPublish,
hotKey: "ctrl+p",
hotKeyWhenHidden: true,
- alias: "saveAndPublish"
+ alias: "saveAndPublish",
+ addEllipsis: args.content.variants && args.content.variants.length > 1 ? "true" : "false"
};
case "H":
//send to publish
@@ -175,7 +176,8 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
handler: args.methods.sendToPublish,
hotKey: "ctrl+p",
hotKeyWhenHidden: true,
- alias: "sendToPublish"
+ alias: "sendToPublish",
+ addEllipsis: args.content.variants && args.content.variants.length > 1 ? "true" : "false"
};
case "A":
//save
@@ -185,7 +187,8 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
handler: args.methods.save,
hotKey: "ctrl+s",
hotKeyWhenHidden: true,
- alias: "save"
+ alias: "save",
+ addEllipsis: args.content.variants && args.content.variants.length > 1 ? "true" : "false"
};
case "Z":
//unpublish
diff --git a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less
index 388d3587c1..4bcc60d5f3 100644
--- a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less
+++ b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less
@@ -9,6 +9,10 @@
left: auto;
}
+.umb-button-group__sub-buttons>li>a {
+ display: flex;
+}
+
.umb-button-group {
.umb-button__button {
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html
index d46c80ddc5..3810630fa9 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html
@@ -12,7 +12,8 @@
shortcut="{{defaultButton.hotKey}}"
shortcut-when-hidden="{{defaultButton.hotKeyWhenHidden}}"
size="{{size}}"
- icon="{{icon}}">
+ icon="{{icon}}"
+ add-ellipsis={{defaultButton.addEllipsis}}>
@@ -23,6 +24,7 @@