aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-12-08 17:35:26 +0100
committerGitHub <noreply@github.com>2016-12-08 17:35:26 +0100
commit621544af2b072e21e42b8d4c1c2bd800cbfdd696 (patch)
tree271306721ea30ca9549a4649eae6059ed5aa4ffa /server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js
parentfb9dd756d3e18058e13384b4119e220d3ae1a43d (diff)
downloadsonarqube-621544af2b072e21e42b8d4c1c2bd800cbfdd696.tar.gz
sonarqube-621544af2b072e21e42b8d4c1c2bd800cbfdd696.zip
SONAR-8505 Implement smooth transition between pages (#1440)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js')
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js b/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js
index 97491378c7f..a28ff4373ce 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesAppContainer.js
@@ -22,10 +22,22 @@ import init from '../init';
export default class CodingRulesAppContainer extends React.Component {
componentDidMount () {
- init(this.refs.container);
+ this.stop = init(this.refs.container);
+ }
+
+ componentWillUnmount () {
+ this.stop();
}
render () {
- return <div ref="container"/>;
+ // placing container inside div is required,
+ // because when backbone.marionette's layout is destroyed,
+ // it also destroys the root element,
+ // but react wants it to be there to unmount it
+ return (
+ <div>
+ <div ref="container"/>
+ </div>
+ );
}
}