diff --git a/build/css/ox.ui.css b/build/css/ox.ui.css index 72bccefe..5551b510 100644 --- a/build/css/ox.ui.css +++ b/build/css/ox.ui.css @@ -118,6 +118,9 @@ Dialog .OxDialog > .OxButtonsBar > .OxButton.OxLeft { float: left; } +.OxDialog > .OxButtonsBar > .OxButton.OxLeft:first-child { + margin-left: 16px; +} .OxDialog > .OxButtonsBar > .OxButton.OxRight { float: right; } diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index b57e4d46..9b305f82 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -1269,6 +1269,7 @@ requires .addClass("OxTitleBar") //.html(self.options.title) .mousedown(drag) + .dblclick(center) .appendTo(that); that.$title = new Ox.Element() .addClass("OxTitle") @@ -1310,6 +1311,16 @@ requires that.$layer = new Ox.Element() .addClass("OxLayer"); + function center() { + that.css({ + left: 0, + top: parseInt(-$document.height() / 10) + "px", // fixme: duplicated + right: 0, + bottom: 0, + margin: "auto" + }); + } + function drag(event) { var documentWidth = $document.width(), documentHeight = $document.height(), diff --git a/demos/test/index.html b/demos/test/index.html index f548c0cb..51d7225f 100644 --- a/demos/test/index.html +++ b/demos/test/index.html @@ -195,10 +195,14 @@ var loginDialog = new Ox.Dialog({ buttons: [ - { value: "Register", click: function() { loginDialog.close(); } }, - { value: "Reset Password", click: function() { loginDialog.close(); } }, - { value: "Cancel", click: function() { loginDialog.close(); } }, - { value: "Login", click: function() { loginDialog.close(); } } + [ + { value: "Register", click: function() { loginDialog.close(); } }, + { value: "Reset Password", click: function() { loginDialog.close(); } } + ], + [ + { value: "Cancel", click: function() { loginDialog.close(); } }, + { value: "Login", click: function() { loginDialog.close(); } } + ] ], title: "Login" });