Skip to content

Commit d2c50eb

Browse files
committed
Merge branch 'osm-master'
2 parents 989d440 + 4061867 commit d2c50eb

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ activeClass
171171
</tr>
172172
<tr>
173173
<td>
174+
activeStyle
175+
</td>
176+
<td>
177+
style applied when element is reached
178+
</td>
179+
</tr>
180+
<tr>
181+
<td>
174182
to
175183
</td>
176184
<td>

modules/mixins/scroll-link.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const protoTypes = {
1010
containerId: PropTypes.string,
1111
container: PropTypes.object,
1212
activeClass: PropTypes.string,
13+
activeStyle: PropTypes.object,
1314
spy: PropTypes.bool,
1415
horizontal: PropTypes.bool,
1516
smooth: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
@@ -207,6 +208,14 @@ export default (Component, customScroller) => {
207208
className = this.props.className;
208209
}
209210

211+
var style = {};
212+
213+
if (this.state && this.state.active) {
214+
style = Object.assign({}, this.props.style, this.props.activeStyle);
215+
} else {
216+
style = Object.assign({}, this.props.style);
217+
}
218+
210219
let props = Object.assign({}, this.props);
211220

212221
for (var prop in protoTypes) {
@@ -216,9 +225,9 @@ export default (Component, customScroller) => {
216225
}
217226

218227
props.className = className;
228+
props.style = style;
219229
props.onClick = this.handleClick;
220230

221-
222231
return React.createElement(Component, props);
223232
}
224233
};

0 commit comments

Comments
 (0)