Bascule sur ReactDOM.findDOMNode()
This commit is contained in:
parent
2ee1ea8cce
commit
5655d4d126
|
@ -88,7 +88,7 @@ var LauncherView = React.createClass({
|
||||||
|
|
||||||
onItemClick: function(evt, itemPath, item) {
|
onItemClick: function(evt, itemPath, item) {
|
||||||
|
|
||||||
console.log(item);
|
logger.debug(item);
|
||||||
|
|
||||||
if(item.items) {
|
if(item.items) {
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
var ReactDOM = require('react-dom');
|
||||||
|
var logger = require('../../util/logger');
|
||||||
|
|
||||||
var Events = {
|
var Events = {
|
||||||
ANIMATION_END: 'webkitAnimationEnd',
|
ANIMATION_END: 'webkitAnimationEnd',
|
||||||
TRANSITION_END: 'webkitTransitionEnd'
|
TRANSITION_END: 'webkitTransitionEnd'
|
||||||
|
@ -8,7 +11,7 @@ module.exports = {
|
||||||
play: function(component, animation) {
|
play: function(component, animation) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
|
|
||||||
var el = component.getDOMNode();
|
var el = ReactDOM.findDOMNode(component);
|
||||||
|
|
||||||
el.addEventListener(Events.ANIMATION_END, onAnimEnd, false);
|
el.addEventListener(Events.ANIMATION_END, onAnimEnd, false);
|
||||||
el.style.webkitAnimation = animation;
|
el.style.webkitAnimation = animation;
|
||||||
|
@ -25,13 +28,13 @@ module.exports = {
|
||||||
transition: function(component, style, time, easing) {
|
transition: function(component, style, time, easing) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
|
|
||||||
console.log('transition start', style, time);
|
logger.debug('transition start', style, time);
|
||||||
|
|
||||||
time = time || '500ms';
|
time = time || '500ms';
|
||||||
easing = easing || 'linear';
|
easing = easing || 'linear';
|
||||||
|
|
||||||
var props = Object.keys(style);
|
var props = Object.keys(style);
|
||||||
var el = component.getDOMNode();
|
var el = ReactDOM.findDOMNode(component);
|
||||||
|
|
||||||
el.style.transition = null;
|
el.style.transition = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue