File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
pages/widgets/components/changes-chart Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ import ChartsMorris from '../../pages/charts/morris';
49
49
import ChartsFlot from '../../pages/charts/flot' ;
50
50
import ChartsSparkline from '../../pages/charts/sparkline' ;
51
51
import ChartsRickshaw from '../../pages/charts/rickshaw' ;
52
- import DashboardAnalytics from '../../pages/analytics' ;
52
+ import DashboardAnalytics from '../../pages/analytics' ;
53
53
import Dashboard from '../../pages/dashboard' ;
54
54
55
55
import Header from '../Header' ;
@@ -83,14 +83,27 @@ class Layout extends React.Component {
83
83
84
84
componentDidMount ( ) {
85
85
const staticSidebar = JSON . parse ( localStorage . getItem ( 'staticSidebar' ) ) ;
86
- if ( staticSidebar ) {
86
+ if ( staticSidebar && window . innerWidth > 768 ) {
87
87
this . props . dispatch ( toggleSidebar ( ) ) ;
88
88
} else if ( this . props . sidebarOpened ) {
89
89
setTimeout ( ( ) => {
90
90
this . props . dispatch ( closeSidebar ( ) ) ;
91
91
this . props . dispatch ( changeActiveSidebarItem ( null ) ) ;
92
92
} , 2500 ) ;
93
93
}
94
+
95
+ this . handleResize ( ) ;
96
+ window . addEventListener ( 'resize' , this . handleResize . bind ( this ) ) ;
97
+ }
98
+
99
+ componentWillUnmount ( ) {
100
+ window . removeEventListener ( 'resize' , this . handleResize . bind ( this ) ) ;
101
+ }
102
+
103
+ handleResize ( ) {
104
+ if ( window . innerWidth <= 768 && this . props . sidebarStatic ) {
105
+ this . props . dispatch ( toggleSidebar ( ) ) ;
106
+ }
94
107
}
95
108
96
109
chatToggle ( ) {
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ class ChangesChart extends React.Component {
114
114
< p className = { s . chartValue } > < i className = "fa fa-caret-up" /> 352.79</ p >
115
115
< p className = { s . chartValueChange } > +2.04 (1.69%)</ p >
116
116
< div
117
+ style = { { overflow : 'hidden' } }
117
118
ref = { ( r ) => {
118
119
this . rickshawChart = r ;
119
120
} }
You can’t perform that action at this time.
0 commit comments