Skip to content

Commit 8d7f5ee

Browse files
author
vrana
committed
Properly change device after resizing left nav
Summary: Also allow left nav to hide. Test Plan: # Resize left nav. # Shrink browser width to switch device. # Increase the width again. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3383
1 parent 6c5a23d commit 8d7f5ee

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/__celerity_resource_map__.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@
10321032
),
10331033
'javelin-behavior-device' =>
10341034
array(
1035-
'uri' => '/res/37669d1a/rsrc/js/application/core/behavior-device.js',
1035+
'uri' => '/res/7f09d952/rsrc/js/application/core/behavior-device.js',
10361036
'type' => 'js',
10371037
'requires' =>
10381038
array(
@@ -1517,7 +1517,7 @@
15171517
),
15181518
'javelin-behavior-phabricator-nav' =>
15191519
array(
1520-
'uri' => '/res/15ceb59f/rsrc/js/application/core/behavior-phabricator-nav.js',
1520+
'uri' => '/res/575be3cd/rsrc/js/application/core/behavior-phabricator-nav.js',
15211521
'type' => 'js',
15221522
'requires' =>
15231523
array(

webroot/rsrc/js/application/core/behavior-device.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ JX.behavior('device', function(config) {
3232
JX.DOM.alterClass(e, 'device-tablet', (device == 'tablet'));
3333
JX.DOM.alterClass(e, 'device-desktop', (device == 'desktop'));
3434

35-
JX.Stratcom.invoke('phabricator-device-change', device);
35+
JX.Stratcom.invoke('phabricator-device-change', null, device);
3636
}
3737

3838
JX.Stratcom.listen('resize', null, onresize);

webroot/rsrc/js/application/core/behavior-phabricator-nav.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ JX.behavior('phabricator-nav', function(config) {
151151
scale: 1,
152152

153153
width: JX.Vector.getDim(local).x,
154-
minWidth: 38,
154+
minWidth: 1,
155155
minScale: 1
156156
},
157157
{
@@ -213,10 +213,16 @@ JX.behavior('phabricator-nav', function(config) {
213213

214214
// - Navigation Reset ----------------------------------------------------------
215215

216-
JX.Stratcom.listen('phabricator-device-change', null, function(device) {
216+
JX.Stratcom.listen('phabricator-device-change', null, function(event) {
217217
app.style.left = '';
218-
local && (local.style.left = '');
219-
content.style.left = '';
218+
if (local) {
219+
local.style.left = '';
220+
local.style.width = '';
221+
}
222+
if (drag) {
223+
drag.style.left = '';
224+
}
225+
content.style.marginLeft = '';
220226

221227
select_button(2);
222228
});

0 commit comments

Comments
 (0)