react-super-components
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -23,3 +23,3 @@ 'use strict'; | ||
require('jquery.appear'); | ||
require('jquery-inview'); | ||
@@ -101,13 +101,10 @@ var _Stack = require('./Stack'); | ||
var _props = this.props; | ||
var lazy = _props.lazy; | ||
var _props$offset = _props.offset; | ||
var offset = _props$offset === undefined ? 0 : _props$offset; | ||
var lazy = this.props.lazy; | ||
var imageNode = (0, _jquery2.default)(_reactDom2.default.findDOMNode(this)); | ||
if (lazy) { | ||
var imageNode = (0, _jquery2.default)(_reactDom2.default.findDOMNode(this)); | ||
imageNode.appear(function () { | ||
return _this2.addListeners(); | ||
}, { accX: 0, accY: offset }); | ||
imageNode.on('inview', function () { | ||
return _this2.addListeners(imageNode); | ||
}); | ||
} else { | ||
@@ -119,3 +116,3 @@ this.addListeners(); | ||
key: 'addListeners', | ||
value: function addListeners() { | ||
value: function addListeners(imageNode) { | ||
var _this3 = this; | ||
@@ -125,2 +122,3 @@ | ||
_this3.setState({ status: 'display' }); | ||
if (imageNode) imageNode.off('inview'); | ||
@@ -151,12 +149,11 @@ var imageDidLoad = _this3.props.imageDidLoad; | ||
var _props2 = this.props; | ||
var src = _props2.src; | ||
var loadingSrc = _props2.loadingSrc; | ||
var style = _props2.style; | ||
var lazy = _props2.lazy; | ||
var offset = _props2.offset; | ||
var imageDidLoad = _props2.imageDidLoad; | ||
var wrapperProps = _props2.wrapperProps; | ||
var _props = this.props; | ||
var src = _props.src; | ||
var loadingSrc = _props.loadingSrc; | ||
var style = _props.style; | ||
var lazy = _props.lazy; | ||
var imageDidLoad = _props.imageDidLoad; | ||
var wrapperProps = _props.wrapperProps; | ||
var other = _objectWithoutProperties(_props2, ['src', 'loadingSrc', 'style', 'lazy', 'offset', 'imageDidLoad', 'wrapperProps']); | ||
var other = _objectWithoutProperties(_props, ['src', 'loadingSrc', 'style', 'lazy', 'imageDidLoad', 'wrapperProps']); | ||
@@ -201,6 +198,5 @@ var status = this.state.status; | ||
imageDidLoad: _react.PropTypes.func, | ||
lazy: _react.PropTypes.bool, | ||
offset: _react.PropTypes.number | ||
lazy: _react.PropTypes.bool | ||
}; | ||
exports.default = Image; |
@@ -42,7 +42,7 @@ { | ||
"jquery": "^2.2.2", | ||
"jquery.appear": "^1.0.1", | ||
"react-virtualized": "^6.1.1", | ||
"react-addons-shallow-compare": "^15.0.1" | ||
"jquery-inview": "^1.1.2", | ||
"react-addons-shallow-compare": "^15.0.1", | ||
"react-virtualized": "^6.1.1" | ||
}, | ||
"version": "1.4.1" | ||
"version": "1.4.2" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79925
1189
+ Addedjquery-inview@^1.1.2
+ Addedjquery-inview@1.1.2(transitive)
- Removedjquery.appear@^1.0.1
- Removedjquery.appear@1.0.1(transitive)