Skip to content

Commit 6672243

Browse files
committed
Merge branch 'bugfixt push origin master-notification-duration-timeout'
2 parents 39f4581 + 153e6f2 commit 6672243

File tree

7 files changed

+25
-17
lines changed

7 files changed

+25
-17
lines changed

components/SLDSNotification/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SLDSNotification extends React.Component {
4646
if(this.props.duration) {
4747
const that = this;
4848
setTimeout(function() {
49-
this.onDismiss();
49+
that.onDismiss();
5050
}, that.props.duration);
5151
}
5252
}

demo/static/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/design-system-react.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12976,11 +12976,15 @@ return /******/ (function(modules) { // webpackBootstrap
1297612976
_createClass(SLDSNotification, [{
1297712977
key: "componentDidMount",
1297812978
value: function componentDidMount() {
12979+
var _this = this;
12980+
1297912981
if (this.props.duration) {
12980-
var that = this;
12981-
setTimeout(function () {
12982-
this.onDismiss();
12983-
}, that.props.duration);
12982+
(function () {
12983+
var that = _this;
12984+
setTimeout(function () {
12985+
that.onDismiss();
12986+
}, that.props.duration);
12987+
})();
1298412988
}
1298512989
}
1298612990
}, {
@@ -12993,12 +12997,12 @@ return /******/ (function(modules) { // webpackBootstrap
1299312997
}, {
1299412998
key: "componentWillReceiveProps",
1299512999
value: function componentWillReceiveProps(nextProps) {
12996-
var _this = this;
13000+
var _this2 = this;
1299713001

1299813002
if (this.props.isOpen !== nextProps.isOpen) {
1299913003
if (nextProps.isOpen && !this.state.interval) {
1300013004
this.setState({ interval: setTimeout(function () {
13001-
_this.setState({ revealForScreenreader: true });
13005+
_this2.setState({ revealForScreenreader: true });
1300213006
}, 500) });
1300313007
}
1300413008
console.log('revealForScreen', this.state.revealForScreenreader);

dist/design-system-react.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/design-system-react.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/design-system-react.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/SLDSNotification/index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ var SLDSNotification = (function (_React$Component) {
7070
_createClass(SLDSNotification, [{
7171
key: "componentDidMount",
7272
value: function componentDidMount() {
73+
var _this = this;
74+
7375
if (this.props.duration) {
74-
var that = this;
75-
setTimeout(function () {
76-
this.onDismiss();
77-
}, that.props.duration);
76+
(function () {
77+
var that = _this;
78+
setTimeout(function () {
79+
that.onDismiss();
80+
}, that.props.duration);
81+
})();
7882
}
7983
}
8084
}, {
@@ -87,12 +91,12 @@ var SLDSNotification = (function (_React$Component) {
8791
}, {
8892
key: "componentWillReceiveProps",
8993
value: function componentWillReceiveProps(nextProps) {
90-
var _this = this;
94+
var _this2 = this;
9195

9296
if (this.props.isOpen !== nextProps.isOpen) {
9397
if (nextProps.isOpen && !this.state.interval) {
9498
this.setState({ interval: setTimeout(function () {
95-
_this.setState({ revealForScreenreader: true });
99+
_this2.setState({ revealForScreenreader: true });
96100
}, 500) });
97101
}
98102
console.log('revealForScreen', this.state.revealForScreenreader);

0 commit comments

Comments
 (0)