diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css
index a1221137bc4..93930bf435f 100644
--- a/core/css/jquery.ocdialog.css
+++ b/core/css/jquery.ocdialog.css
@@ -31,6 +31,17 @@
margin-top: 10px;
width: 100%;
}
+/* align primary button to right, other buttons to left */
+.oc-dialog-buttonrow.twobuttons button:nth-child(1) {
+ float: left;
+}
+.oc-dialog-buttonrow.twobuttons button:nth-child(2) {
+ float: right;
+}
+
+.oc-dialog-buttonrow.onebutton button {
+ float: right;
+}
.oc-dialog-close {
position:absolute;
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js
index af32591ce52..e48e3e8df6a 100644
--- a/core/js/jquery.ocdialog.js
+++ b/core/js/jquery.ocdialog.js
@@ -111,6 +111,13 @@
var $buttonrow = $('
');
this.$buttonrow = $buttonrow.appendTo(this.$dialog);
}
+ if (value.length === 1) {
+ this.$buttonrow.addClass('onebutton');
+ } else if (value.length === 2) {
+ this.$buttonrow.addClass('twobuttons');
+ } else if (value.length === 3) {
+ this.$buttonrow.addClass('threebuttons');
+ }
$.each(value, function(idx, val) {
var $button = $('