Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/react-nipple/lib/ReactNipple.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ var ReactNipple = (_class = function (_Component) {
value: function handleElement(ref) {
this._element = ref;
if (ref) {
this.createJoystick(this.props);
this.createJoystick();
} else if (this._element) {
this.destroyJoystick();
}
}
}, {
key: 'createJoystick',
value: function createJoystick(props) {
value: function createJoystick() {
var options = _extends({
zone: this._element
}, props.options);
}, this.props.options);

if (this.props.static) {
options.mode = 'static';
Expand All @@ -145,8 +145,8 @@ var ReactNipple = (_class = function (_Component) {

this.joystick = joystick;

if (props.onCreated) {
props.onCreated(this.joystick);
if (this.props.onCreated) {
this.props.onCreated(this.joystick);
}
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-nipple/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-nipple",
"version": "1.0.2",
"version": "1.0.3",
"main": "lib/index.js",
"license": "MIT",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions packages/react-nipple/src/ReactNipple.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ export default class ReactNipple extends Component {
handleElement(ref) {
this._element = ref;
if (ref) {
this.createJoystick(this.props);
this.createJoystick();
} else if (this._element) {
this.destroyJoystick();
}
}
createJoystick(props) {
createJoystick() {
const options = {
zone: this._element,
...props.options
...this.props.options
};

if (this.props.static) {
Expand All @@ -143,8 +143,8 @@ export default class ReactNipple extends Component {

this.joystick = joystick;

if (props.onCreated) {
props.onCreated(this.joystick);
if (this.props.onCreated) {
this.props.onCreated(this.joystick);
}
}
destroyJoystick() {
Expand Down