зеркало из https://github.com/mozilla/pjs.git
Patch from Matthew Wilson <msw@gimp.org> -- keep the popup layer in a reasonable place on the screen.
This commit is contained in:
Родитель
31261d92a4
Коммит
8711847dba
|
@ -161,8 +161,15 @@ function js_who_menu(n,extra,d) {
|
||||||
}
|
}
|
||||||
l = document.layers['popup'];
|
l = document.layers['popup'];
|
||||||
l.src="../registry/who.cgi?email="+n+extra;
|
l.src="../registry/who.cgi?email="+n+extra;
|
||||||
l.top = d.target.y - 6;
|
|
||||||
|
if(d.target.y > window.innerHeight + window.pageYOffset - l.clip.height) {
|
||||||
|
l.top = (window.innerHeight + window.pageYOffset - l.clip.height);
|
||||||
|
} else {
|
||||||
|
l.top = d.target.y - 6;
|
||||||
|
}
|
||||||
|
|
||||||
l.left = d.target.x - 6;
|
l.left = d.target.x - 6;
|
||||||
|
|
||||||
if( l.left + l.clipWidth > window.width ){
|
if( l.left + l.clipWidth > window.width ){
|
||||||
l.left = window.width - l.clipWidth;
|
l.left = window.width - l.clipWidth;
|
||||||
}
|
}
|
||||||
|
@ -177,11 +184,18 @@ function js_file_menu(dir,file,rev,root,d) {
|
||||||
l = document.layers['popup'];
|
l = document.layers['popup'];
|
||||||
l.src="../registry/file.cgi?file="+file+"&dir="+dir+"&rev="+rev+"&cvsroot="+root+"&linked_text="+d.target.text;
|
l.src="../registry/file.cgi?file="+file+"&dir="+dir+"&rev="+rev+"&cvsroot="+root+"&linked_text="+d.target.text;
|
||||||
|
|
||||||
l.top = d.target.y - 6;
|
if(d.target.y > window.innerHeight + window.pageYOffset - l.clip.height) {
|
||||||
|
l.top = (window.innerHeight + window.pageYOffset - l.clip.height);
|
||||||
|
} else {
|
||||||
|
l.top = d.target.y - 6;
|
||||||
|
}
|
||||||
|
|
||||||
l.left = d.target.x - 6;
|
l.left = d.target.x - 6;
|
||||||
|
|
||||||
if( l.left + l.clipWidth > window.width ){
|
if( l.left + l.clipWidth > window.width ){
|
||||||
l.left = window.width - l.clipWidth;
|
l.left = window.width - l.clipWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
l.visibility="show";
|
l.visibility="show";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче