Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
48323776
Commit
48323776
authored
6 years ago
by
chrisgarrity
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
Remove cruft and add comments to explain how setLocale is called.
parent
446acfbe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/containers/blocks.jsx
+4
-6
4 additions, 6 deletions
src/containers/blocks.jsx
with
4 additions
and
6 deletions
src/containers/blocks.jsx
+
4
−
6
View file @
48323776
...
...
@@ -94,6 +94,8 @@ class Blocks extends React.Component {
addFunctionListener
(
this
.
workspace
,
'
zoom
'
,
this
.
onWorkspaceMetricsChange
);
this
.
attachVM
();
// Only update blocks/vm locale when visible to avoid sizing issues
// If locale changes while not visible it will get handled in didUpdate
if
(
this
.
props
.
isVisible
)
{
this
.
setLocale
();
}
...
...
@@ -119,10 +121,6 @@ class Blocks extends React.Component {
this
.
ScratchBlocks
.
hideChaff
();
}
// if (prevProps.locale !== this.props.locale) {
// this.setLocale();
// }
if
(
prevProps
.
toolboxXML
!==
this
.
props
.
toolboxXML
)
{
// rather than update the toolbox "sync" -- update it in the next frame
clearTimeout
(
this
.
toolboxUpdateTimeout
);
...
...
@@ -140,9 +138,10 @@ class Blocks extends React.Component {
// @todo hack to resize blockly manually in case resize happened while hidden
// @todo hack to reload the workspace due to gui bug #413
if
(
this
.
props
.
isVisible
)
{
// Scripts tab
this
.
workspace
.
setVisible
(
true
);
if
(
prevProps
.
locale
!==
this
.
props
.
locale
||
this
.
props
.
locale
!==
this
.
props
.
vm
.
getLocale
())
{
// call setLocale if the locale has changed, or changed while the blocks were hidden.
// vm.getLocale() will be out of sync if locale was changed while not visible
this
.
setLocale
();
}
else
{
this
.
props
.
vm
.
refreshWorkspace
();
...
...
@@ -150,7 +149,6 @@ class Blocks extends React.Component {
// Re-enable toolbox refreshes without causing one. See #updateToolbox for more info.
this
.
workspace
.
toolboxRefreshEnabled_
=
true
;
// this.workspace.setToolboxRefreshEnabled(true);
window
.
dispatchEvent
(
new
Event
(
'
resize
'
));
}
else
{
this
.
workspace
.
setVisible
(
false
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment