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
3cea22ac
Commit
3cea22ac
authored
8 years ago
by
Ray Schamp
Browse files
Options
Downloads
Patches
Plain Diff
Fix editingTarget selection
parent
24389c30
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/sprite-selector.jsx
+13
-13
13 additions, 13 deletions
src/containers/sprite-selector.jsx
with
13 additions
and
13 deletions
src/containers/sprite-selector.jsx
+
13
−
13
View file @
3cea22ac
const
bindAll
=
require
(
'
lodash.bindall
'
);
const
{
connect
}
=
require
(
'
react-redux
'
);
const
React
=
require
(
'
react
'
);
const
VM
=
require
(
'
scratch-vm
'
);
const
{
updateEditingTarget
}
=
require
(
'
../reducers/targets
'
);
const
{
connect
}
=
require
(
'
react-redux
'
);
const
BackdropLibrary
=
require
(
'
./backdrop-library.jsx
'
);
const
CostumeLibrary
=
require
(
'
./costume-library.jsx
'
);
...
...
@@ -20,7 +19,8 @@ class SpriteSelector extends React.Component {
'
handleCloseSpriteLibrary
'
,
'
handleNewBackdropClick
'
,
'
handleNewCostumeClick
'
,
'
handleNewSpriteClick
'
'
handleNewSpriteClick
'
,
'
handleSelectSprite
'
]);
this
.
state
=
{
backdropLibraryVisible
:
false
,
...
...
@@ -49,6 +49,8 @@ class SpriteSelector extends React.Component {
}
handleCloseSpriteLibrary
()
{
this
.
setState
({
spriteLibraryVisible
:
false
});
handleSelectSprite
(
id
)
{
this
.
props
.
vm
.
setEditingTarget
(
id
);
}
render
()
{
const
{
...
...
@@ -58,7 +60,7 @@ class SpriteSelector extends React.Component {
targets
,
vm
,
/* eslint-enable no-unused-vars */
...
p
rops
...
componentP
rops
}
=
this
.
props
;
return
(
<
div
...
...
@@ -70,32 +72,32 @@ class SpriteSelector extends React.Component {
}
}
>
<
SpriteSelectorComponent
selectedId
=
{
this
.
props
.
editingTarget
}
sprites
=
{
this
.
props
.
targets
}
onSelectSprite
=
{
this
.
props
.
on
SelectSprite
}
{
...
p
rops
}
selectedId
=
{
editingTarget
}
sprites
=
{
targets
}
onSelectSprite
=
{
this
.
handle
SelectSprite
}
{
...
componentP
rops
}
/>
<
p
>
<
button
onClick
=
{
this
.
handleNewSpriteClick
}
>
New Sprite
</
button
>
<
SpriteLibrary
mediaLibrary
=
{
mediaLibrary
}
visible
=
{
this
.
state
.
spriteLibraryVisible
}
vm
=
{
this
.
props
.
vm
}
onRequestClose
=
{
this
.
handleCloseSpriteLibrary
}
vm
=
{
vm
}
/>
<
button
onClick
=
{
this
.
handleNewCostumeClick
}
>
New Costume
</
button
>
<
CostumeLibrary
mediaLibrary
=
{
mediaLibrary
}
visible
=
{
this
.
state
.
costumeLibraryVisible
}
vm
=
{
this
.
props
.
vm
}
onRequestClose
=
{
this
.
handleCloseCostumeLibrary
}
vm
=
{
vm
}
/>
<
button
onClick
=
{
this
.
handleNewBackdropClick
}
>
New Backdrop
</
button
>
<
BackdropLibrary
mediaLibrary
=
{
mediaLibrary
}
visible
=
{
this
.
state
.
backdropLibraryVisible
}
vm
=
{
this
.
props
.
vm
}
onRequestClose
=
{
this
.
handleCloseBackdropLibrary
}
vm
=
{
vm
}
/>
</
p
>
</
div
>
...
...
@@ -106,7 +108,6 @@ class SpriteSelector extends React.Component {
SpriteSelector
.
propTypes
=
{
editingTarget
:
React
.
PropTypes
.
string
,
mediaLibrary
:
React
.
PropTypes
.
instanceOf
(
MediaLibrary
),
onSelectSprite
:
React
.
PropTypes
.
func
,
targets
:
React
.
PropTypes
.
objectOf
(
React
.
PropTypes
.
shape
({
costume
:
React
.
PropTypes
.
shape
({
skin
:
React
.
PropTypes
.
string
,
...
...
@@ -127,7 +128,6 @@ const mapStateToProps = state => ({
editingTarget
:
state
.
targets
.
editingTarget
});
const
mapDispatchToProps
=
dispatch
=>
({
onSelectSprite
:
id
=>
dispatch
(
updateEditingTarget
(
id
))
});
module
.
exports
=
connect
(
...
...
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