react-scroll
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -8,3 +8,2 @@ /* React */ | ||
import Link from '../components/Link.js'; | ||
import DirectLink from '../components/DirectLink.js'; | ||
import events from '../mixins/scroll-events.js'; | ||
@@ -34,3 +33,3 @@ import animateScroll from '../mixins/animate-scroll.js'; | ||
<li><Link to="test5" spy={true} smooth={true} duration={scrollDuration}>Test 5</Link></li> | ||
<li><DirectLink to="test6" spy={true} smooth={true} duration={scrollDuration}>Test 6</DirectLink></li> | ||
<li><Link to="test6" spy={true} smooth={true} duration={scrollDuration}>Test 6</Link></li> | ||
</ul> | ||
@@ -56,3 +55,3 @@ <Element name="test1" className="element">test 1</Element> | ||
it('direct link calls begin and end event', (done) => { | ||
render(component, node, () => { | ||
@@ -59,0 +58,0 @@ |
@@ -8,3 +8,2 @@ /* React */ | ||
import Link from '../components/Link.js'; | ||
import DirectLink from '../components/DirectLink.js'; | ||
import events from '../mixins/scroll-events.js'; | ||
@@ -32,3 +31,3 @@ /* Test */ | ||
<li><Link to="test5" spy={true} smooth={true} duration={scrollDuration}>Test 5</Link></li> | ||
<li><DirectLink to="anchor" spy={true} smooth={true} duration={scrollDuration}>Test 6</DirectLink></li> | ||
<li><Link to="anchor" spy={true} smooth={true} duration={scrollDuration}>Test 6</Link></li> | ||
</ul> | ||
@@ -35,0 +34,0 @@ <Element name="test1" className="element">test 1</Element> |
exports.Link = require('./components/Link.js'); | ||
exports.DirectLink = require('./components/DirectLink.js'); | ||
exports.Button = require('./components/Button.js'); | ||
@@ -7,5 +6,4 @@ exports.Element = require('./components/Element.js'); | ||
exports.scroller = require('./mixins/scroller.js'); | ||
exports.directScroller = require('./mixins/direct-scroller.js'); | ||
exports.Events = require('./mixins/scroll-events.js'); | ||
exports.scrollSpy = require('./mixins/scroll-spy.js'); | ||
exports.animateScroll = require('./mixins/animate-scroll.js'); |
@@ -128,4 +128,9 @@ var assign = require('object-assign'); | ||
var setContainer = function (options) { | ||
if(!options || !options.containerId) { return; } | ||
__containerElement = document.getElementById(options.containerId); | ||
if(!options || !options.containerId) { | ||
__containerElement = null; | ||
return; | ||
} | ||
if(!__containerElement) { | ||
__containerElement = document.getElementById(options.containerId); | ||
} | ||
}; | ||
@@ -137,6 +142,5 @@ | ||
if(!__containerElement) { | ||
setContainer(options); | ||
} | ||
setContainer(options); | ||
__start = null; | ||
@@ -143,0 +147,0 @@ __cancel = false; |
@@ -24,3 +24,3 @@ var assign = require('object-assign'); | ||
get: function(name) { | ||
return __mapped[name]; | ||
return __mapped[name] || document.getElementById(name); | ||
}, | ||
@@ -45,3 +45,4 @@ | ||
if(!target) { | ||
throw new Error("target Element not found"); | ||
console.warn("target Element not found"); | ||
return; | ||
} | ||
@@ -48,0 +49,0 @@ |
{ | ||
"name": "react-scroll", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "A scroll component for React.js", | ||
@@ -5,0 +5,0 @@ "main": "lib", |
@@ -281,3 +281,3 @@ ## React Scroll | ||
return ( | ||
<div> | ||
<div {...this.props}> | ||
{this.props.children} | ||
@@ -294,3 +294,3 @@ </div> | ||
return ( | ||
<a> | ||
<a {...this.props}> | ||
{this.props.children} | ||
@@ -297,0 +297,0 @@ </a> |
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
39714