Skip to content

Commit 2e80cbe

Browse files
author
pipeline
committed
feature(Ej2-5420): Chart plunk issue fixes
1 parent f673677 commit 2e80cbe

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed
56 Bytes
Binary file not shown.
62 Bytes
Binary file not shown.

src/common/index.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,17 @@ if (isMobile) {
9797
select('.sb-left-pane-footer').appendChild(select('.sb-footer-left'));
9898
select('.sb-left-pane').classList.add('sb-hide');
9999
leftToggle.classList.remove('toggle-active');
100-
101100
} else {
102101
leftPane.classList.remove('sb-hide');
103102
}
103+
/**
104+
* Tab View
105+
*/
106+
if (isTablet || (Browser.isDevice && isPc)) {
107+
leftToggle.classList.remove('toggle-active');
108+
select('.sb-left-pane').classList.add('sb-hide');
109+
select('.sb-right-pane').classList.add('control-fullview');
110+
}
104111
changeMouseOrTouch(switchText);
105112
localStorage.removeItem('ej2-switch');
106113
enableRipple(selectedTheme === 'material' || !selectedTheme);
@@ -552,6 +559,9 @@ export function toggleLeftPane(): void {
552559
leftPane.style.overflowY = '';
553560
resizeManualTrigger = true;
554561
window.dispatchEvent(new Event('resize'));
562+
if (Browser.isDevice) {
563+
window.dispatchEvent(new Event('orientationchange'));
564+
}
555565
resizeManualTrigger = false;
556566
}
557567
});
@@ -593,17 +603,17 @@ function processResize(e: any): void {
593603
if (footer.parentElement.classList.contains('sb-left-pane-footer')) {
594604
select('.sb-footer').appendChild(footer);
595605
}
596-
if (isTablet) {
606+
if (isTablet || (Browser.isDevice && isPc)) {
597607
if (!leftPane.classList.contains('sb-hide')) {
598608
toggleLeftPane();
599609
}
600610
setTimeout(() => {
601611
if (!rightPane.classList.contains('control-fullview')) {
602612
rightPane.classList.add('control-fullview');
603613
}
604-
}, 500);
614+
}, 600);
605615
}
606-
if (isPc) {
616+
if (isPc && !Browser.isDevice) {
607617
if (isVisible('.sb-left-pane')) {
608618
rightPane.classList.remove('control-fullview');
609619
} else {

src/common/leftpane.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { selectDefaultTab } from './component-content';
1010

1111
let isMobile: boolean;
1212
let isTablet: boolean;
13+
let isPc: boolean;
1314
let sampleOrder: string[] = [];
1415
let controlSampleData: any = {};
1516

@@ -186,14 +187,16 @@ export class LeftPane extends React.Component<{}, {}> {
186187
if (path) {
187188
this.controlListRefresh(arg.node || arg.item);
188189
if (path !== curHashCollection) {
190+
isMobile = window.matchMedia('(max-width:550px)').matches;
191+
isTablet = window.matchMedia('(min-width:600px) and (max-width: 850px)').matches;
192+
isPc = window.matchMedia('(min-width:850px)').matches;
189193
sampleOverlay();
190194
let theme: string = location.hash.split('/')[1] || 'material';
191-
location.hash = '#/' + theme + path;
192-
}
193-
isMobile = window.matchMedia('(max-width:550px)').matches;
194-
isTablet = window.matchMedia('(min-width:600px) and (max-width: 850px)').matches;
195-
if ((arg.item && isMobile && !select('.sb-left-pane').classList.contains('sb-hide')) || (isTablet && isLeftPaneOpen())) {
196-
toggleLeftPane();
195+
if (arg.item && ((isMobile && !select('.sb-mobile-left-pane').classList.contains('sb-hide')) ||
196+
((isTablet || (Browser.isDevice && isPc)) && isLeftPaneOpen()))) {
197+
toggleLeftPane();
198+
}
199+
setTimeout(() => { location.hash = '#/' + theme + path; }, 600);
197200
}
198201
}
199202
}

0 commit comments

Comments
 (0)