Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
114e4504
Commit
114e4504
authored
May 15, 2018
by
Jaden DIEFENBAUGH
Browse files
[toolchains] throttle clicking tc blocks to ignore doubleclicks, closes
#107
parent
b9ff5b63
Pipeline
#20110
passed with stages
in 152 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
conda/js/src/components/toolchain/ToolchainEditor.jsx
View file @
114e4504
...
...
@@ -882,16 +882,23 @@ export class ToolchainEditor extends React.PureComponent<Props, State> {
}
}
lastClickMs
=
0
// handles left clicking on a block
handleBlockClick
=
(
blockName
:
string
,
set
:
BlockSet
)
=>
{
const
newMBI
=
{
set
,
name
:
blockName
,
active
:
true
,
};
this
.
setState
({
modalBlockInfo
:
newMBI
,
});
const
currTime
=
Date
.
now
();
// 1sec throttling
const
delay
=
1000
;
if
(
currTime
-
this
.
lastClickMs
>
delay
){
const
newMBI
=
{
set
,
name
:
blockName
,
active
:
true
,
};
this
.
setState
({
modalBlockInfo
:
newMBI
,
});
}
this
.
lastClickMs
=
currTime
;
}
// uses the server's /layout endpoint to get a graphviz layout for this toolchain
...
...
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