forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request facebook#6005 from milesj/synthetic-transition
Added support for synthetic animation/transition events.
- Loading branch information
Showing
8 changed files
with
287 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/renderers/dom/client/syntheticEvents/SyntheticAnimationEvent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule SyntheticAnimationEvent | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var SyntheticEvent = require('SyntheticEvent'); | ||
|
||
/** | ||
* @interface Event | ||
* @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent | ||
*/ | ||
var AnimationEventInterface = { | ||
animationName: null, | ||
elapsedTime: null, | ||
pseudoElement: null, | ||
}; | ||
|
||
/** | ||
* @param {object} dispatchConfig Configuration used to dispatch this event. | ||
* @param {string} dispatchMarker Marker identifying the event target. | ||
* @param {object} nativeEvent Native browser event. | ||
* @extends {SyntheticEvent} | ||
*/ | ||
function SyntheticAnimationEvent( | ||
dispatchConfig, | ||
dispatchMarker, | ||
nativeEvent, | ||
nativeEventTarget | ||
) { | ||
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); | ||
} | ||
|
||
SyntheticEvent.augmentClass( | ||
SyntheticAnimationEvent, | ||
AnimationEventInterface | ||
); | ||
|
||
module.exports = SyntheticAnimationEvent; |
47 changes: 47 additions & 0 deletions
47
src/renderers/dom/client/syntheticEvents/SyntheticTransitionEvent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule SyntheticTransitionEvent | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var SyntheticEvent = require('SyntheticEvent'); | ||
|
||
/** | ||
* @interface Event | ||
* @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent | ||
*/ | ||
var TransitionEventInterface = { | ||
propertyName: null, | ||
elapsedTime: null, | ||
pseudoElement: null, | ||
}; | ||
|
||
/** | ||
* @param {object} dispatchConfig Configuration used to dispatch this event. | ||
* @param {string} dispatchMarker Marker identifying the event target. | ||
* @param {object} nativeEvent Native browser event. | ||
* @extends {SyntheticEvent} | ||
*/ | ||
function SyntheticTransitionEvent( | ||
dispatchConfig, | ||
dispatchMarker, | ||
nativeEvent, | ||
nativeEventTarget | ||
) { | ||
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); | ||
} | ||
|
||
SyntheticEvent.augmentClass( | ||
SyntheticTransitionEvent, | ||
TransitionEventInterface | ||
); | ||
|
||
module.exports = SyntheticTransitionEvent; |
Oops, something went wrong.