Skip to content

Commit

Permalink
Merge pull request #3308 from newoga/#3305/popover
Browse files Browse the repository at this point in the history
[Popover] Remove window-listenable mixin
  • Loading branch information
oliviertassinari committed Feb 12, 2016
2 parents 96e106b + a32da08 commit d4472ee
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/popover/popover.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import WindowListenable from '../mixins/window-listenable';
import EventListener from 'react-event-listener';
import RenderToLayer from '../render-to-layer';
import PropTypes from '../utils/prop-types';
import Paper from '../paper';
Expand Down Expand Up @@ -107,10 +107,6 @@ const Popover = React.createClass({
muiTheme: React.PropTypes.object,
},

mixins: [
WindowListenable,
],

getDefaultProps() {
return {
anchorOrigin: {
Expand Down Expand Up @@ -187,11 +183,6 @@ const Popover = React.createClass({
this.setPlacement();
},

windowListeners: {
resize: 'setPlacementThrottled',
scroll: 'setPlacementThrottledScrolled',
},

renderLayer() {
const {
animated,
Expand Down Expand Up @@ -388,13 +379,20 @@ const Popover = React.createClass({

render() {
return (
<RenderToLayer
ref="layer"
open={this.state.open}
componentClickAway={this.componentClickAway}
useLayerForClickAway={this.props.useLayerForClickAway}
render={this.renderLayer}
/>
<noscript>
<EventListener
elementName="window"
onScroll={this.setPlacementThrottledScrolled}
onResize={this.setPlacementThrottled}
/>
<RenderToLayer
ref="layer"
open={this.state.open}
componentClickAway={this.componentClickAway}
useLayerForClickAway={this.props.useLayerForClickAway}
render={this.renderLayer}
/>
</noscript>
);
},

Expand Down

0 comments on commit d4472ee

Please sign in to comment.