Active
Project:
Popups API (Ajax Dialogs) [D7]
Version:
6.x-2.0-alpha5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2009 at 22:26 UTC
Updated:
5 Sep 2010 at 15:58 UTC
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?
Comments
Comment #1
kvvnn commentedUPDATE:
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.
Comment #2
kvvnn commentedChanging 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();
};
Comment #3
capellicI had the same problem, but I am using version 1.3. I replaced the whole "Drupal.popups.refocus" function with the code in #2 code and it worked. What's interesting is that there is even a comment in the original code, "doesn't seem to work."
From:
To: