Page MenuHomeIn-Portal Phabricator

D460.diff
No OneTemporary

File Metadata

Created
Mon, Jan 6, 6:54 AM

D460.diff

Index: core/admin_templates/js/forms.js
===================================================================
--- core/admin_templates/js/forms.js
+++ core/admin_templates/js/forms.js
@@ -291,7 +291,7 @@
var h = (document.all ? window.document.body.offsetHeight : window.innerHeight);
var $div = $(this.Div);
- var pos = this.GetOffsetWithoutUserScroll($div);
+ var pos = this.GetOffsetWithoutUserScroll($div, $init_done);
h -= pos.top;
@@ -370,15 +370,18 @@
// print_pre(this.Controls)
};
-Form.GetOffsetWithoutUserScroll = function ($div) {
- var $ret,
- $wrapper_div = $div.parent(),
- $old_scroll_top = $wrapper_div.scrollTop();
+Form.GetOffsetWithoutUserScroll = function ($div, $init_done) {
+ var $ret, $wrapper_div, $old_scroll_top;
- $wrapper_div.scrollTop(0);
+ if ( $init_done === false ) {
+ return $div.offset();
+ }
- $ret = $div.offset();
+ $wrapper_div = $div.parent();
+ $old_scroll_top = $wrapper_div.scrollTop();
+ $wrapper_div.scrollTop(0);
+ $ret = $div.offset();
$wrapper_div.scrollTop($old_scroll_top);
return $ret;

Event Timeline