allow for dialog that does not gain focus
This commit is contained in:
parent
917608950d
commit
428744c8bf
1 changed files with 12 additions and 6 deletions
|
@ -19,6 +19,7 @@ Ox.Dialog = function(options, self) {
|
|||
title: '',
|
||||
buttons: [],
|
||||
content: null,
|
||||
focus: true,
|
||||
height: 216,
|
||||
keys: {},
|
||||
minHeight: 144,
|
||||
|
@ -318,8 +319,10 @@ Ox.Dialog = function(options, self) {
|
|||
that.$buttons.forEach(function($button) {
|
||||
$button.removeElement();
|
||||
});
|
||||
that.loseFocus();
|
||||
that.$layer.removeElement();
|
||||
if (self.options.focus) {
|
||||
that.loseFocus();
|
||||
that.$layer.removeElement();
|
||||
}
|
||||
that.removeElement();
|
||||
callback();
|
||||
});
|
||||
|
@ -359,7 +362,9 @@ Ox.Dialog = function(options, self) {
|
|||
|
||||
that.open = function() {
|
||||
//Ox.print('before open')
|
||||
that.$layer.appendTo(Ox.UI.$body);
|
||||
if (self.options.focus) {
|
||||
that.$layer.appendTo(Ox.UI.$body);
|
||||
}
|
||||
that.css({
|
||||
opacity: 0
|
||||
}).appendTo(Ox.UI.$body).animate({
|
||||
|
@ -367,9 +372,10 @@ Ox.Dialog = function(options, self) {
|
|||
}, 200);
|
||||
center();
|
||||
reset();
|
||||
// fixme: the following line prevents preview-style dialog
|
||||
that.gainFocus();
|
||||
Ox.UI.$window.bind('mouseup', mouseupLayer);
|
||||
if (self.options.focus) {
|
||||
that.gainFocus();
|
||||
Ox.UI.$window.bind('mouseup', mouseupLayer);
|
||||
}
|
||||
//Ox.print('after open')
|
||||
return that;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue