@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make column show/hide behaviors a little simpler

Summary: Ref T7062. The previous fix caused an extra, unnecessary thread load on mobile. Make this code a bit simpler and fix the unnecessary load.

Test Plan: No more load on mobile.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7062

Differential Revision: https://secure.phabricator.com/D12196

+43 -54
+14 -14
resources/celerity/map.php
··· 45 45 'rsrc/css/application/config/setup-issue.css' => '22270af2', 46 46 'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2', 47 47 'rsrc/css/application/conpherence/durable-column.css' => 'e2011d85', 48 - 'rsrc/css/application/conpherence/menu.css' => '2c1c727c', 48 + 'rsrc/css/application/conpherence/menu.css' => '9b37a261', 49 49 'rsrc/css/application/conpherence/message-pane.css' => '44154798', 50 50 'rsrc/css/application/conpherence/notification.css' => '04a6e10a', 51 51 'rsrc/css/application/conpherence/update.css' => '1099a660', ··· 354 354 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 355 355 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', 356 356 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'bb928342', 357 - 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'cccebf26', 357 + 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'c81c2bba', 358 358 'rsrc/js/application/conpherence/behavior-menu.js' => 'de5579b4', 359 359 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', 360 360 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', ··· 515 515 'config-options-css' => '7fedf08b', 516 516 'config-welcome-css' => '6abd79be', 517 517 'conpherence-durable-column-view' => 'e2011d85', 518 - 'conpherence-menu-css' => '2c1c727c', 518 + 'conpherence-menu-css' => '9b37a261', 519 519 'conpherence-message-pane-css' => '44154798', 520 520 'conpherence-notification-css' => '04a6e10a', 521 521 'conpherence-thread-manager' => 'bb928342', ··· 584 584 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 585 585 'javelin-behavior-diffusion-pull-lastmodified' => '2b228192', 586 586 'javelin-behavior-doorkeeper-tag' => 'e5822781', 587 - 'javelin-behavior-durable-column' => 'cccebf26', 587 + 'javelin-behavior-durable-column' => 'c81c2bba', 588 588 'javelin-behavior-error-log' => '6882e80a', 589 589 'javelin-behavior-fancy-datepicker' => 'c51ae228', 590 590 'javelin-behavior-global-drag-and-drop' => 'bbdf75ca', ··· 1736 1736 'javelin-stratcom', 1737 1737 'javelin-vector', 1738 1738 ), 1739 + 'c81c2bba' => array( 1740 + 'javelin-behavior', 1741 + 'javelin-dom', 1742 + 'javelin-stratcom', 1743 + 'javelin-behavior-device', 1744 + 'javelin-scrollbar', 1745 + 'javelin-quicksand', 1746 + 'phabricator-keyboard-shortcut', 1747 + 'conpherence-thread-manager', 1748 + ), 1739 1749 'c90a04fc' => array( 1740 1750 'javelin-dom', 1741 1751 'javelin-dynval', ··· 1749 1759 'javelin-dom', 1750 1760 'javelin-stratcom', 1751 1761 'phabricator-phtize', 1752 - ), 1753 - 'cccebf26' => array( 1754 - 'javelin-behavior', 1755 - 'javelin-dom', 1756 - 'javelin-stratcom', 1757 - 'javelin-behavior-device', 1758 - 'javelin-scrollbar', 1759 - 'javelin-quicksand', 1760 - 'phabricator-keyboard-shortcut', 1761 - 'conpherence-thread-manager', 1762 1762 ), 1763 1763 'd19198c8' => array( 1764 1764 'javelin-install',
+29 -40
webroot/rsrc/js/application/conpherence/behavior-durable-column.js
··· 24 24 statics.initialized = true; 25 25 } 26 26 27 - var show = false; 27 + var userVisible = config.visible; 28 + var show = null; 28 29 var loadThreadID = null; 29 30 var scrollbar = null; 30 31 ··· 43 44 return JX.DOM.find(column, 'div', 'conpherence-durable-column-main'); 44 45 } 45 46 46 - function _autocloseColumn() { 47 + function _isViewportWideEnoughForColumn() { 47 48 var viewport = JX.Vector.getViewport(); 48 49 if (viewport.x < minimumViewportWidth) { 49 - if (show) { 50 - _toggleColumn(false); 51 - resizeClose = true; 52 - } 50 + return false; 51 + } else { 53 52 return true; 54 - } else { 55 - if (resizeClose) { 56 - resizeClose = false; 57 - if (!show) { 58 - _toggleColumn(false); 59 - } 60 - } 61 53 } 54 + } 62 55 63 - return false; 56 + function _updateColumnVisibility() { 57 + var new_value = (userVisible && _isViewportWideEnoughForColumn()); 58 + if (new_value !== show) { 59 + show = new_value; 60 + _drawColumn(show); 61 + } 64 62 } 65 63 66 64 function _toggleColumn(explicit) { 67 - if (explicit) { 68 - if (_autocloseColumn()) { 69 - return; 70 - } 71 - } 65 + userVisible = !userVisible; 66 + _updateColumnVisibility(); 67 + 68 + new JX.Request(config.settingsURI) 69 + .setData({value: (show ? 1 : 0)}) 70 + .send(); 71 + } 72 72 73 - show = !show; 74 - JX.DOM.alterClass(document.body, 'with-durable-column', show); 73 + function _drawColumn(visible) { 74 + JX.DOM.alterClass(document.body, 'with-durable-column', visible); 75 75 var column = _getColumnNode(); 76 - if (show) { 76 + if (visible) { 77 77 JX.DOM.show(column); 78 78 threadManager.loadThreadByID(loadThreadID); 79 79 } else { 80 80 JX.DOM.hide(column); 81 81 } 82 - JX.Stratcom.invoke('resize'); 83 - JX.Quicksand.setFrame(show ? quick : null); 82 + JX.Quicksand.setFrame(visible ? quick : null); 84 83 85 84 // When we activate the column, adjust the tablet breakpoint so that we 86 85 // convert the left side of the screen to tablet mode on narrow displays. 87 86 var breakpoint = JX.Device.getTabletBreakpoint(); 88 87 JX.Device.setTabletBreakpoint( 89 - show ? (breakpoint + columnWidth) : (breakpoint - columnWidth)); 88 + visible ? (breakpoint + columnWidth) : (breakpoint - columnWidth)); 90 89 91 - // If this was an explicit toggle action from the user, save their 92 - // preference. 93 - if (explicit) { 94 - new JX.Request(config.settingsURI) 95 - .setData({value: (show ? 1 : 0)}) 96 - .send(); 97 - } 90 + JX.Stratcom.invoke('resize'); 98 91 } 99 92 100 93 new JX.KeyboardShortcut('\\', 'Toggle Conpherence Column') 101 - .setHandler(JX.bind(null, _toggleColumn, true)) 94 + .setHandler(_toggleColumn) 102 95 .register(); 103 96 104 97 scrollbar = new JX.Scrollbar(_getColumnScrollNode()); ··· 193 186 break; 194 187 case 'hide_column': 195 188 JX.Stratcom.invoke('notification-panel-close'); 196 - _toggleColumn(true); 189 + _toggleColumn(); 197 190 break; 198 191 } 199 192 }); ··· 220 213 threadManager.loadThreadByID(data.threadID); 221 214 }); 222 215 223 - var resizeClose = false; 224 - JX.Stratcom.listen('resize', null, _autocloseColumn); 216 + JX.Stratcom.listen('resize', null, _updateColumnVisibility); 225 217 226 218 function _getColumnBodyNode() { 227 219 var column = JX.$('conpherence-durable-column'); ··· 347 339 } 348 340 }); 349 341 350 - if (config.visible) { 351 - _toggleColumn(false); 352 - _autocloseColumn(); 353 - } 342 + _updateColumnVisibility(); 354 343 355 344 });