-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Gave search result panel a min-height #5391
Changes from 2 commits
fabaa6b
429ae86
4e2ff45
f2bd6b2
5aff268
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,7 +139,7 @@ define(function (require, exports, module) { | |
| * @param {!string} position Which side of the element can be dragged: one of the POSITION_* constants | ||
| * (TOP/BOTTOM for vertical resizing or LEFT/RIGHT for horizontal). | ||
| * @param {?number} minSize Minimum size (width or height) of the element's outer dimensions, including | ||
| * border & padding. Defaults to 0. | ||
| * border & padding. Defaults to 100. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment should say "DEFAULT_MIN_SIZE" in stead of "100" in case the default is ever changed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DEFAULT_MIN_SIZE is not part of the public API, so it should just be DEFAULT_MIN_SIZE. |
||
| * @param {?boolean} collapsible Indicates the panel is collapsible on double click on the | ||
| * resizer. Defaults to false. | ||
| * @param {?string} forceLeft CSS selector indicating element whose 'left' should be locked to the | ||
|
|
@@ -162,8 +162,11 @@ define(function (require, exports, module) { | |
| elementSizeFunction = direction === DIRECTION_HORIZONTAL ? $element.width : $element.height, | ||
| resizerCSSPosition = direction === DIRECTION_HORIZONTAL ? "left" : "top", | ||
| contentSizeFunction = direction === DIRECTION_HORIZONTAL ? $resizableElement.width : $resizableElement.height; | ||
|
|
||
| minSize = minSize || 0; | ||
|
|
||
| if (minSize === undefined) { | ||
| minSize = DEFAULT_MIN_SIZE; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if i'm wrong but from what I understand, DEFAULT_MIN_SIZE is defined for this purpose i.e. to set a min-size on a panel.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. Good catch! |
||
| } | ||
|
|
||
| collapsible = collapsible || false; | ||
|
|
||
| $element.prepend($resizer); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this fixes the problem. But,
Resizermodule used to set 100 as the default minimum size -- not sure when or why that changed.It seems like a more complete solution would be to change Resizer.js line 166 from:
to
@peterflynn Since you commented on the bug, I'll ask you: can you think of any case that this would not be desirable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redmunds I agree,
seems to be safer but I believe that
is a more general design. Furthermore, if the default value is 100 it is not posible to hide elements by dragging (e.g. the side panel) because:
So I think the default value should be 0.
(I'm new here and want to learn so I am open to any solution)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I think the default should be 100, but any panel should be able to override this with 0 (although dragging size to 0 is not a good way to hide panel as is shown in the bug), so this should be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but isn't it better to use DEFAULT_MIN_SIZE instead of a hard coded integer? (see comment below: src/utils/Resizer.js:167)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that default panel height is 100, it's no longer necessary to pass 100 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, but if we don't pass 100 as an argument here we shouldn't do that on the error panel (https://github.com/adobe/brackets/blob/master/src/language/CodeInspection.js#L387) nor the find-replace-panel (https://github.com/adobe/brackets/blob/master/src/search/FindReplace.js#L627) to keep consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to leave it in, it's just not "necessary". I don't think it's worth updating that other code.