-
Notifications
You must be signed in to change notification settings - Fork 17
/
ScrollBlocker.js
34 lines (27 loc) · 1020 Bytes
/
ScrollBlocker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/** @jsx React.DOM */
var React = require('react');
var assign = require('react/lib/Object.assign');
var blockerStyle = {
pointerEvents: 'none'
};
var ScrollBlocker = React.createClass({displayName: "ScrollBlocker",
propTypes: {
active: React.PropTypes.bool,
style: React.PropTypes.object,
children: React.PropTypes.node
},
getDefaultProps: function () {
return {
active: false
};
},
render: function () {
var $__0= this.props,style=$__0.style,active=$__0.active,other=(function(source, exclusion) {var rest = {};var hasOwn = Object.prototype.hasOwnProperty;if (source == null) {throw new TypeError();}for (var key in source) {if (hasOwn.call(source, key) && !hasOwn.call(exclusion, key)) {rest[key] = source[key];}}return rest;})($__0,{style:1,active:1});
return (
React.createElement("div", React.__spread({}, other, {style: assign({}, style, active && blockerStyle)}),
this.props.children
)
);
}
});
module.exports = ScrollBlocker;