Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1174160
D461.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Oct 1, 10:55 PM
Size
921 B
Mime Type
text/x-diff
Expires
Thu, Oct 2, 10:55 PM (16 h, 30 m)
Engine
blob
Format
Raw Data
Handle
761183
Attached To
D461: INP-1855 - Support for window scrolling offset in the "Form" JS class
D461.id.diff
View Options
Index: core/admin_templates/js/forms.js
===================================================================
--- core/admin_templates/js/forms.js
+++ core/admin_templates/js/forms.js
@@ -201,8 +201,23 @@
}, 100);
});
+ // Record scrollTop before window contents is changed during Resize.
+ var $window_scroll_top = $(window).scrollTop();
+
this.Resize(false);
+ /*
+ * Transform window scrollTop into "#{this.Div.id}_container" scrollTop.
+ *
+ * The transformation isn't exact, because scrollable area became narrower
+ * due to the fact, that it now includes a scroll bar. That in turn introduces
+ * text wrapping, which might increase table height altogether.
+ */
+ if ( $window_scroll_top > 0 ) {
+ $(window).scrollTop(0);
+ $('#' + this.Div.id + '_container').scrollTop($window_scroll_top - $(this.Div).offset().top);
+ }
+
this.displayFirstError();
if (_Simultaneous_Edit_Message != '') {
Event Timeline
Log In to Comment