making dialog re-center on doubleclick on title bar
This commit is contained in:
parent
5e10355c1a
commit
4bdac7c195
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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"
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user