mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
When you make the file tree huge, scroll to the right, and then toggle it, stop it from growing
Summary: Depends on D19346. Ref PHI568. I love Javascript. Test Plan: - Viewed a revision. - Dragged file tree view really wide. - Scrolled document to the right. - Toggled file tree off and on by pressing "f" twice. - Before patch: file tree grew wider and wider after it was toggled. - After patch: file tree stayed the same size after it was toggled. - Dragged to various widths and reloaded to make sure the "sticky across reloads" behavior still works. - Scrolled right, dragged the tree a bit, then reloaded and didn't see it flip out. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D19347
This commit is contained in:
parent
55619e8964
commit
ac570fd4bc
2 changed files with 25 additions and 16 deletions
|
@ -10,7 +10,7 @@ return array(
|
|||
'conpherence.pkg.css' => 'e68cf1fa',
|
||||
'conpherence.pkg.js' => '15191c65',
|
||||
'core.pkg.css' => '39061f68',
|
||||
'core.pkg.js' => '1ea38af8',
|
||||
'core.pkg.js' => 'e1f0f7bd',
|
||||
'differential.pkg.css' => '06dc617c',
|
||||
'differential.pkg.js' => 'c2ca903a',
|
||||
'diffusion.pkg.css' => 'a2d17c7d',
|
||||
|
@ -475,7 +475,7 @@ return array(
|
|||
'rsrc/js/core/behavior-more.js' => 'a80d0378',
|
||||
'rsrc/js/core/behavior-object-selector.js' => '77c1f0b0',
|
||||
'rsrc/js/core/behavior-oncopy.js' => '2926fff2',
|
||||
'rsrc/js/core/behavior-phabricator-nav.js' => '836f966d',
|
||||
'rsrc/js/core/behavior-phabricator-nav.js' => '94b7c320',
|
||||
'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'acd29eee',
|
||||
'rsrc/js/core/behavior-read-only-warning.js' => 'ba158207',
|
||||
'rsrc/js/core/behavior-redirect.js' => '0213259f',
|
||||
|
@ -635,7 +635,7 @@ return array(
|
|||
'javelin-behavior-phabricator-keyboard-pager' => 'a8da01f0',
|
||||
'javelin-behavior-phabricator-keyboard-shortcuts' => '01fca1f0',
|
||||
'javelin-behavior-phabricator-line-linker' => '1e017314',
|
||||
'javelin-behavior-phabricator-nav' => '836f966d',
|
||||
'javelin-behavior-phabricator-nav' => '94b7c320',
|
||||
'javelin-behavior-phabricator-notification-example' => '8ce821c5',
|
||||
'javelin-behavior-phabricator-object-selector' => '77c1f0b0',
|
||||
'javelin-behavior-phabricator-oncopy' => '2926fff2',
|
||||
|
@ -1547,16 +1547,6 @@ return array(
|
|||
'javelin-behavior',
|
||||
'javelin-scrollbar',
|
||||
),
|
||||
'836f966d' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-behavior-device',
|
||||
'javelin-stratcom',
|
||||
'javelin-dom',
|
||||
'javelin-magical-init',
|
||||
'javelin-vector',
|
||||
'javelin-request',
|
||||
'javelin-util',
|
||||
),
|
||||
'8499b6ab' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
@ -1658,6 +1648,16 @@ return array(
|
|||
'javelin-resource',
|
||||
'javelin-routable',
|
||||
),
|
||||
'94b7c320' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-behavior-device',
|
||||
'javelin-stratcom',
|
||||
'javelin-dom',
|
||||
'javelin-magical-init',
|
||||
'javelin-vector',
|
||||
'javelin-request',
|
||||
'javelin-util',
|
||||
),
|
||||
'960f6a39' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
|
|
@ -49,7 +49,7 @@ JX.behavior('phabricator-nav', function(config) {
|
|||
{
|
||||
element: drag,
|
||||
parameter: 'left',
|
||||
start: JX.$V(drag).x
|
||||
start: get_width()
|
||||
},
|
||||
{
|
||||
element: content,
|
||||
|
@ -102,15 +102,24 @@ JX.behavior('phabricator-nav', function(config) {
|
|||
.setData(
|
||||
{
|
||||
key: 'filetree.width',
|
||||
value: JX.$V(drag).x
|
||||
value: get_width()
|
||||
})
|
||||
.send();
|
||||
});
|
||||
|
||||
function get_width() {
|
||||
// See PHI568. If the document has scrolled horizontally, the "x" position
|
||||
// of the bar will be the actual width of the menu plus the horizontal
|
||||
// scroll position (because the element is "position: fixed"). Subtract the
|
||||
// document scroll position when saving the element width so that scrolling
|
||||
// to the right and then toggling the filetree UI does not make it grow
|
||||
// any wider.
|
||||
return (JX.$V(drag).x - JX.Vector.getScroll().x);
|
||||
}
|
||||
|
||||
var saved_width = config.width;
|
||||
function savedrag() {
|
||||
saved_width = JX.$V(drag).x;
|
||||
saved_width = get_width();
|
||||
|
||||
local.style.width = '';
|
||||
drag.style.left = '';
|
||||
|
|
Loading…
Reference in a new issue