Popup window scroll position
kevin riggen - July 26, 2009 - 22:26
| Project: | Popups API (Ajax Dialogs) |
| Version: | 6.x-2.0-alpha5 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Oy!
Is there a way to set the horizontal scrollbar position in the Popup window to the very top?
At the moment the vertical scrollbar defaults at the center.
I was thinking even something like : $popup.focus( $('popupTitle') );
Any guidance?

#1
UPDATE:
It seems that only when I open nodes with comments within a popup window does the vertical scrollbar default in the middle. Otherwise, the scrollbar is positioned at the top.
#2
Changing this bit of code in popups.js fixed my problem.
/**
* Set the focus on the popups to the first visible, enabled form element, or the close link.
*/
Popups.Popup.prototype.refocus = function() {
// Select the first visible enabled input element.
var $popup = this.$popup();
// kvn ( Tim ) // var $focus = $popup.find(':input:visible:enabled:first');
// kvn ( Tim ) // if (!$focus.length) {
// There is no visible enabled input element, so select the close link.
$focus = $popup.find('.popups-close a'); // kvn ( Tim )
//}
$focus.focus();
};