Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Patrik Meijer
react-components
Commits
4d6c1859
Commit
4d6c1859
authored
Mar 19, 2019
by
Patrik Meijer
Browse files
Fix some styling
parent
e0f7d8ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/components/GraphEditor/GraphEditor.jsx
View file @
4d6c1859
...
...
@@ -545,9 +545,7 @@ ${activeSelection.includes(edgeId) ? ' in-active-selection' : ''}`,
y
:
orgEvent
.
clientY
,
},
},
});
setTimeout
(()
=>
{
},
()
=>
{
setActiveSelection
([
nodeId
]);
});
}
...
...
src/components/GraphEditor/ReactCytoscape.jsx
View file @
4d6c1859
...
...
@@ -38,23 +38,31 @@ export default class ReactCytoscape extends Component {
};
componentDidMount
()
{
const
{
style
,
layout
,
elements
,
hyperEdges
,
cytoscapeOptions
,
cyRef
,
}
=
this
.
props
;
const
opts
=
Object
.
assign
({
container
:
this
.
container
,
boxSelectionEnabled
:
false
,
autounselectify
:
true
,
style
:
this
.
props
.
style
,
layout
:
this
.
props
.
layout
,
},
this
.
props
.
cytoscapeOptions
);
style
,
layout
,
},
cytoscapeOptions
);
this
.
cy
=
cytoscape
(
opts
);
this
.
edgeConnHandler
=
this
.
cy
.
edgeConnections
();
this
.
cy
.
json
({
elements
:
this
.
props
.
elements
});
this
.
edgeConnHandler
.
addEdges
(
this
.
props
.
hyperEdges
);
this
.
cy
.
json
({
elements
});
this
.
edgeConnHandler
.
addEdges
(
hyperEdges
);
if
(
this
.
props
.
cyRef
)
{
this
.
props
.
cyRef
(
this
.
cy
,
this
.
container
);
if
(
cyRef
)
{
cyRef
(
this
.
cy
,
this
.
container
);
}
return
this
.
cy
;
...
...
@@ -97,17 +105,18 @@ export default class ReactCytoscape extends Component {
}
render
()
{
const
{
style
,
containerID
}
=
this
.
props
;
const
styleContainer
=
Object
.
assign
({
height
:
'
100%
'
,
width
:
'
100%
'
,
display
:
'
block
'
,
position
:
'
relative
'
,
top
:
-
40
,
// Magic: this is to float under the action buttons
},
...
this
.
props
.
style
);
},
...
style
);
return
(
<
div
className
=
"graph"
id
=
{
this
.
props
.
containerID
}
id
=
{
containerID
}
ref
=
{
(
elt
)
=>
{
this
.
container
=
elt
;
}
}
...
...
src/components/SubTreeWatcher/SubTreeWatcher.jsx
View file @
4d6c1859
...
...
@@ -80,12 +80,13 @@ export default class SubTreeWatcher extends Component {
componentWillReceiveProps
(
newProps
)
{
const
{
activeNode
}
=
newProps
;
const
{
options
:
currOptions
,
activeNode
:
currActiveNode
}
=
this
.
props
;
if
(
newProps
.
options
!==
this
.
props
.
o
ptions
)
{
if
(
newProps
.
options
!==
currO
ptions
)
{
this
.
options
=
Object
.
assign
(
DEFAULT_OPTIONS
,
newProps
.
options
);
}
if
(
activeNode
!==
this
.
props
.
a
ctiveNode
)
{
if
(
activeNode
!==
currA
ctiveNode
)
{
this
.
setState
({
territory
:
{
[
activeNode
]:
{
children
:
this
.
options
.
depth
},
...
...
@@ -212,7 +213,7 @@ export default class SubTreeWatcher extends Component {
render
()
{
const
{
territory
,
children
}
=
this
.
state
;
const
{
gmeClient
}
=
this
.
props
;
const
{
gmeClient
,
children
:
childElements
}
=
this
.
props
;
return
(
<
div
style
=
{
{
width
:
'
100%
'
,
height
:
'
100%
'
}
}
>
...
...
@@ -224,7 +225,7 @@ export default class SubTreeWatcher extends Component {
reuseTerritory
=
{
false
}
/>
{
React
.
cloneElement
(
React
.
Children
.
only
(
this
.
props
.
children
),
React
.
Children
.
only
(
childElements
),
Object
.
assign
({},
this
.
props
,
{
nodes
:
children
}),
)
}
</
div
>);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment