Project

General

Profile

Bug #3677 » 0001-Raise-WDialog-to-front-on-mousedown-not-click.patch

Bruce Toll, 11/25/2014 09:24 PM

View differences:

src/Wt/WDialog
void create();
void onEscapePressed();
void onDefaultPressed();
void bringToFront();
void bringToFront(const WMouseEvent &e);
DialogCover *cover();
};
src/Wt/WDialog.C
}
if (!isModal())
titleBar()->clicked().connect(this, &WDialog::bringToFront);
titleBar()->mouseWentDown().connect(this, &WDialog::bringToFront);
if ( (flags & RenderFull) && autoFocus_)
impl_->setFirstFocus();
......
return 0;
}
void WDialog::bringToFront()
void WDialog::bringToFront(const WMouseEvent &e)
{
doJavaScript("jQuery.data(" + jsRef() + ", 'obj').bringToFront()");
DialogCover *c = cover();
c->bringToFront(this);
if (e.button() == WMouseEvent::LeftButton &&
e.modifiers() == KeyboardModifier::NoModifier) {
doJavaScript("jQuery.data(" + jsRef() + ", 'obj').bringToFront()");
DialogCover *c = cover();
c->bringToFront(this);
}
}
}
src/js/WDialog.js
};
if (titlebar) {
titlebar.onmousedown = function(event) {
$(titlebar).mousedown(function(event) {
var e = event||window.event;
if (e.which !== 1) {
return;
}
WT.capture(titlebar);
var pc = WT.pageCoordinates(e);
dsx = pc.x;
dsy = pc.y;
titlebar.onmousemove = handleMove;
};
});
titlebar.onmouseup = function(event) {
titlebar.onmousemove = null;
(1-1/3)