-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Simulate indentation of the project tree using some divs #12047
Conversation
* @return {ReactComponent} - The resulting div. | ||
*/ | ||
function _createThickness(depth) { | ||
return DOM.div({ |
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.
Does this div
have defined display
as inline-block
?
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 just saw it is defined in the thickness
class, may be we can define it inside the style
prop?
@dibosh Thank you to have looked at it. |
@marcelgerber if you have a bit of time could you take a look? |
* | ||
* Create an appropriate div based thickness to indent the tree correctly. | ||
* | ||
* @param {int} depth - The depthness of the current node. |
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.
Nit, but depthness
is no word ;)
LGTM, but I'd like to have someone else have a look at the React code (even though it looks straighforward) since I don't know nothing about React. |
@marcelgerber Thank you. |
className: "jstree-icon" | ||
}, " "), | ||
]; | ||
var thickness = _createThickness(this.props.depth); |
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.
Nit: Consecutive var
s are usually either separated with a dot or new line
Reviewed this, made a few comments 👍 |
I've updated the PR. |
*/ | ||
function _createThickness(depth) { | ||
return DOM.div({ | ||
className: "thickness", | ||
style: { | ||
width: (INDENTATION_WIDTH * depth) + "px" | ||
display: "inline-block", | ||
width: INDENTATION_WIDTH * depth |
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.
Unitless value here, does React automatically convert it to px
?
@marcelgerber LGTM, but has merge conflicts after some recent changes. |
d865862
to
39416d3
Compare
I made some changes so to fix the rename case too. So it needs another look. |
@marcelgerber I fixed that issue, but now when you rename a folder the element with the children ( There is a |
You probably didn't see this comment: |
If you can somehow manage to not apply |
instead of using combinations of padding/margin. Fixes adobe#10574
5969de2
to
dc8cb32
Compare
I noticed another small issue were selecting a folder would result in a blue border. |
LGTM. Going for it. |
Thank you @marcelgerber @petetnt @dibosh for review |
Update tests after #12047
instead of using combinations of padding/margin.
Fixes #10574