Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 71bf017

Browse files
committed
Add cleanup bug number to TODO. Improve docs on Resizer.
1 parent 2b4fc26 commit 71bf017

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

src/document/DocumentManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
* The 2nd arg to the listener is the array of removed FileEntry objects.
7171
* - workingSetReorder -- When the indexes of 2 files are swapped. Listener receives no arguments.
7272
* - workingSetSort -- When the workingSet array is sorted. Listener receives no arguments.
73-
* TODO: combine workingSetSort & workingSetReorder since they don't convey different information?
73+
* TODO (#2076): combine workingSetSort & workingSetReorder since they convey nearly identical information.
7474
*
7575
* - fileNameChange -- When the name of a file or folder has changed. The 2nd arg is the old name.
7676
* The 3rd arg is the new name.

src/utils/Resizer.js

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@
3333
* "bottom-resizer", "left-resizer" and "right-resizer" classes control the
3434
* position of the resizer on the element.
3535
*
36-
* An element can be made resizable at any time using the `makeResizable` API
36+
* An element can be made resizable at any time using the `makeResizable()` API.
37+
* Panel sizes are saved via preferences and restored when the DOM node becomes resizable
38+
* again in a subsequent launch.
3739
*
3840
* The resizable elements trigger a panelResizeStart, panelResizeUpdate and panelResizeEnd
3941
* event that can be used to create performance optimizations (such as hiding/showing elements
40-
* while resizing), custom or internal resizes and save the final resized value into local
41-
* storage for example.
42+
* while resizing), custom layout logic, etc. See makeResizable() for details on the events.
4243
*
43-
* A resizable element can be collapsed/expanded using the `show`, `hide` and `toggle` APIs
44-
*
45-
* The resizable elements trigger a panelCollapsed and panelExpanded event when the panel toggles
46-
* between visible and invisible
44+
* A resizable element can be collapsed/expanded using the `show`, `hide` and `toggle` APIs or
45+
* via user action. This triggers panelCollapsed/panelExpanded events - see makeResizable().
4746
*/
4847
define(function (require, exports, module) {
4948
"use strict";
@@ -122,20 +121,25 @@ define(function (require, exports, module) {
122121
* - Left ("left") or right ("right") for horizontal resizing
123122
*
124123
* A resizable element triggers the following events while resizing:
125-
* - panelResizeStart: When the resize starts
126-
* - panelResizeUpdate: When the resize gets updated
127-
* - panelResizeEnds: When the resize ends
128-
* - panelCollapsed: When the panel gets collapsed (or hidden)
129-
* - panelExpanded: When the panel gets expanded (or shown)
124+
* - panelResizeStart: When the resize starts. Passed the new size.
125+
* - panelResizeUpdate: When the resize gets updated. Passed the new size.
126+
* - panelResizeEnd: When the resize ends. Passed the final size.
127+
* - panelCollapsed: When the panel gets collapsed (or hidden). Passed the last size
128+
* before collapse. May occur without any resize events.
129+
* - panelExpanded: When the panel gets expanded (or shown). Passed the initial size.
130+
* May occur without any resize events.
131+
* TODO (#2079): Spurious resize events may occur after collapse or before expand, reporting
132+
* the wrong size. If a panel is currently hidden (display:none), ignore these events.
130133
*
131-
* @param {DOMNode} element Html element which should be made resizable.
132-
* @param {string} direction The direction of the resize action. Must be "horz" or "vert".
133-
* @param {string} position The position of the resizer on the element. Can be "top" or "bottom"
134-
* for vertical resizing and "left" or "right" for horizontal resizing.
135-
* @param {int} minSize Minimum size (width or height) of the element.
136-
* @param {boolean} collapsible True indicates the panel is collapsible on double click
137-
* on the resizer.
138-
* @param {string} forcemargin Classes which margins need to be pushed when the element resizes
134+
* @param {!DOMNode} element DOM element which should be made resizable.
135+
* @param {!string} direction Direction of the resize action: one of the DIRECTION_* constants.
136+
* @param {!string} position Which side of the element can be dragged: one of the POSITION_* constants
137+
* (TOP/BOTTOM for vertical resizing or LEFT/RIGHT for horizontal).
138+
* @param {?number} minSize Minimum size (width or height) of the element. Defaults to 0.
139+
* @param {?boolean} collapsible Indicates the panel is collapsible on double click on the
140+
* resizer. Defaults to false.
141+
* @param {?string} forcemargin CSS selector indicating element whose margin-left should be locked to
142+
* the resizable elemnt's size.
139143
*/
140144
function makeResizable(element, direction, position, minSize, collapsible, forcemargin) {
141145

0 commit comments

Comments
 (0)