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

Commit 67df79b

Browse files
committed
Code review: better description of PanelManager/Resizer's use of DOM ids
1 parent a42b1e3 commit 67df79b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/utils/Resizer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ define(function (require, exports, module) {
111111
}
112112

113113
/**
114-
* Adds resizing capabilities to a given html element.
114+
* Adds resizing and (optionally) expand/collapse capabilities to a given html element. The element's size
115+
* & visibility are automatically saved & restored as a view-state preference.
115116
*
116117
* Resizing can be configured in two directions:
117118
* - Vertical ("vert"): Resizes the height of the element
@@ -130,7 +131,8 @@ define(function (require, exports, module) {
130131
* - panelExpanded: When the panel gets expanded (or shown). Passed the initial size.
131132
* May occur without any resize events.
132133
*
133-
* @param {!DOMNode} element DOM element which should be made resizable. Must have an id attribute.
134+
* @param {!DOMNode} element DOM element which should be made resizable. Must have an id attribute, for
135+
* use as a preferences key.
134136
* @param {!string} direction Direction of the resize action: one of the DIRECTION_* constants.
135137
* @param {!string} position Which side of the element can be dragged: one of the POSITION_* constants
136138
* (TOP/BOTTOM for vertical resizing or LEFT/RIGHT for horizontal).

src/view/PanelManager.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,12 @@ define(function (require, exports, module) {
183183

184184

185185
/**
186-
* Creates a new panel beneath the editor area and above the status bar footer. Panel is initially invisible.
186+
* Creates a new resizabel panel beneath the editor area and above the status bar footer. Panel is initially invisible.
187+
* The panel's size & visibility are automatically saved & restored as a view-state preference.
187188
*
188189
* @param {!string} id Unique id for this panel. Use package-style naming, e.g. "myextension.feature.panelname"
189-
* @param {!jQueryObject} $panel DOM content to use as the panel. Need not be in the document yet. Must have an id.
190+
* @param {!jQueryObject} $panel DOM content to use as the panel. Need not be in the document yet. Must have an id
191+
* attribute, for use as a preferences key.
190192
* @param {number=} minSize Minimum height of panel in px.
191193
* @return {!Panel}
192194
*/

0 commit comments

Comments
 (0)