Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
react-spd
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0843d50f
authored
May 22, 2017
by
hfpp2012 yinsigan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add autobind
1 parent
1800ba88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
12 deletions
package.json
src/components/Element.js
yarn.lock
package.json
View file @
0843d50
...
...
@@ -14,6 +14,7 @@
"react"
:
"^15.5.4"
,
"react-addons-update"
:
"^15.5.2"
,
"react-alert"
:
"^2.0.1"
,
"react-autobind"
:
"^1.0.6"
,
"react-bootstrap"
:
"^0.31.0"
,
"react-dom"
:
"^15.5.4"
,
"react-router-dom"
:
"^4.1.1"
,
...
...
src/components/Element.js
View file @
0843d50
import
React
from
'react'
import
Move
from
'../libs/move'
import
EventEmitter
from
'../libs/eventEmitter'
import
autoBind
from
'react-autobind'
export
default
class
Element
extends
React
.
Component
{
static
get
getDefaultProps
()
{
...
...
@@ -23,18 +24,7 @@ export default class Element extends React.Component {
name
:
this
.
props
.
name
,
prev_name
:
this
.
props
.
name
};
this
.
onMouseDown
=
this
.
onMouseDown
.
bind
(
this
);
this
.
onMouseMove
=
this
.
onMouseMove
.
bind
(
this
);
this
.
onMouseUp
=
this
.
onMouseUp
.
bind
(
this
);
this
.
handleCloneElement
=
this
.
handleCloneElement
.
bind
(
this
);
this
.
handleDeleteLastElement
=
this
.
handleDeleteLastElement
.
bind
(
this
);
this
.
handleMoveDropZone
=
this
.
handleMoveDropZone
.
bind
(
this
);
this
.
handleClick
=
this
.
handleClick
.
bind
(
this
);
this
.
handleChange
=
this
.
handleChange
.
bind
(
this
);
this
.
handleBlur
=
this
.
handleBlur
.
bind
(
this
);
this
.
handleKeyPress
=
this
.
handleKeyPress
.
bind
(
this
);
this
.
handleUpdateName
=
this
.
handleUpdateName
.
bind
(
this
);
this
.
handleDoubleClick
=
this
.
handleDoubleClick
.
bind
(
this
);
autoBind
(
this
);
}
componentDidUpdate
(
props
,
state
)
{
...
...
yarn.lock
View file @
0843d50
...
...
@@ -3301,6 +3301,10 @@ react-alert@^2.0.1:
react-transition-group "^1.1.2"
shortid "^2.2.8"
react-autobind@^1.0.6:
version "1.0.6"
resolved "http://registry.npm.taobao.org/react-autobind/download/react-autobind-1.0.6.tgz#936bb58edf6b89b619c50f82f0e617159fdfd4f1"
react-bootstrap@^0.31.0:
version "0.31.0"
resolved "http://registry.npm.taobao.org/react-bootstrap/download/react-bootstrap-0.31.0.tgz#bbca804c0404d9c640102b2b656ae4cd5bea35c8"
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment