Browse Source

Bascule sur ReactDOM.findDOMNode()

William Petit 3 years ago
parent
commit
5655d4d126
2 changed files with 7 additions and 4 deletions
  1. 1
    1
      src/components/launcher/launcher-view.js
  2. 6
    3
      src/components/mixins/animate.js

+ 1
- 1
src/components/launcher/launcher-view.js View File

@@ -88,7 +88,7 @@ var LauncherView = React.createClass({
88 88
 
89 89
   onItemClick: function(evt, itemPath, item) {
90 90
 
91
-    console.log(item);
91
+    logger.debug(item);
92 92
 
93 93
     if(item.items) {
94 94
 

+ 6
- 3
src/components/mixins/animate.js View File

@@ -1,3 +1,6 @@
1
+var ReactDOM = require('react-dom');
2
+var logger = require('../../util/logger');
3
+
1 4
 var Events = {
2 5
   ANIMATION_END: 'webkitAnimationEnd',
3 6
   TRANSITION_END: 'webkitTransitionEnd'
@@ -8,7 +11,7 @@ module.exports = {
8 11
   play: function(component, animation) {
9 12
     return new Promise(function(resolve, reject) {
10 13
 
11
-      var el = component.getDOMNode();
14
+      var el = ReactDOM.findDOMNode(component);
12 15
 
13 16
       el.addEventListener(Events.ANIMATION_END, onAnimEnd, false);
14 17
       el.style.webkitAnimation = animation;
@@ -25,13 +28,13 @@ module.exports = {
25 28
   transition: function(component, style, time, easing) {
26 29
     return new Promise(function(resolve, reject) {
27 30
 
28
-      console.log('transition start', style, time);
31
+      logger.debug('transition start', style, time);
29 32
 
30 33
       time = time || '500ms';
31 34
       easing = easing || 'linear';
32 35
 
33 36
       var props = Object.keys(style);
34
-      var el = component.getDOMNode();
37
+      var el = ReactDOM.findDOMNode(component);
35 38
 
36 39
       el.style.transition = null;
37 40