Skip to content

Commit 730ca56

Browse files
author
pipeline
committed
Ej2 5128 bug fix
1 parent 4e10a4a commit 730ca56

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

src/common/left-pane.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
</div>
77
</div>
88
</div>
9-
<div class="sb-home">
9+
<div class="sb-home" onclick="document.getElementById('sb-home').click()">
1010
<div class="sb-home-link sb-icons sb-icon-Home"></div>
1111
<div class="sb-home-text">
1212
<span>HOME</span>
13+
<a id="sb-home" href="http://ej2.syncfusion.com/home/angular.html"></a>
1314
</div>
1415
</div>
1516
<div class="sb-control-navigation e-view">
@@ -19,8 +20,7 @@
1920
<div class="e-icons back-icon"></div>
2021
<div class="control-name">ALL CONTROLS</div>
2122
</div>
22-
<ej-listview id="controlList" #controlList class="e-view" [dataSource]="listData" [fields]="listFields" (select)='onSampleSelect($event)'
23-
(actionComplete)='afterListviewRendered($event)'>
23+
<ej-listview id="controlList" #controlList class="e-view" [dataSource]="listData" [fields]="listFields" (select)='onSampleSelect($event)' (actionComplete)='afterListviewRendered($event)'>
2424
<ng-template #template let-data>
2525
<div class="e-text-content e-icon-wrapper">
2626
<span class="e-list-text" role="listitem">{{data.name}}

src/common/sb.component.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export class SBController {
7272
public previousViewMode: string = '';
7373
public viewModeChanged: boolean = false;
7474
public resizeTimer: number = 0;
75-
75+
public prevSampleName: string = '';
76+
public prevControlName: string = '';
7677
//Bread Crumb Object
7778
public breadCrumbObject:
7879
{
@@ -280,7 +281,6 @@ export class SBController {
280281
})
281282
.subscribe((event: any) => {
282283
this.updateSourceCode(location.hash);
283-
this.updateDescription();
284284
this.setListItemSelect();
285285
this.createOpenNewButton();
286286
this.updateViewMode();
@@ -292,6 +292,10 @@ export class SBController {
292292
if (this.currentControl !== this.prevControl) {
293293
this.updateListViewDS();
294294
}
295+
this.setScrollTop();
296+
if (this.prevSampleName !== this.sampleName || this.currentControl !== this.prevControl) {
297+
this.updateDescription();
298+
}
295299
});
296300

297301
this.router.events
@@ -317,6 +321,8 @@ export class SBController {
317321
localStorage.removeItem('pointer');
318322
}
319323
this.isInitialRender = false;
324+
this.prevSampleName = this.sampleName;
325+
this.prevControlName = this.currentControl;
320326
});
321327
}
322328

@@ -558,7 +564,7 @@ export class SBController {
558564

559565
onChangeTheme(e: Event) {
560566
let target: Element = <HTMLElement>e.target;
561-
target = closest(target,'.e-list');
567+
target = closest(target, '.e-list');
562568
let themeName: string = target.id;
563569
this.switchTheme(themeName);
564570
this.themePopup.hide();
@@ -747,6 +753,15 @@ export class SBController {
747753
}
748754
}
749755

756+
setScrollTop() {
757+
let rightPane: HTMLElement = <HTMLElement>select('.sb-right-pane');
758+
if (this.isMobile) {
759+
rightPane.scrollTop = 74;
760+
} else {
761+
rightPane.scrollTop = 0;
762+
}
763+
}
764+
750765
updateSourceCode(path: string): void {
751766
let pathArray: string[] = path.split('/');
752767
pathArray = pathArray.slice(2);
@@ -777,11 +792,11 @@ export class SBController {
777792
let content: string = res._body
778793
if (/html/g.test(fileName)) {
779794
content = this.getStringWithOutDescription(content, /(\'|\")description/g);
780-
content = this.getStringWithOutDescription(content, /(\'|\")action-description/g)
781-
content = content.replace(/&/g, '&amp;')
782-
.replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
795+
content = this.getStringWithOutDescription(content, /(\'|\")action-description/g)
783796
}
784797
if (!/-plnkr\.json/g.test(fileName)) {
798+
content = content.replace(/&/g, '&amp;')
799+
.replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
785800
items.push({
786801
header: { text: fileName },
787802
data: content,

src/common/sb.router.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ const appRoutes: any = [
5252
{ path: 'multiselect', loadChildren: MultiSelectSampleModule },
5353
{ path: 'contextmenu', loadChildren: MenuModule },
5454
{ path: ':theme/tab/:sample', redirectTo: 'material/tab/default' },
55-
{ path: '', redirectTo: 'material/chart/line', pathMatch: 'full' }
55+
{ path: '', redirectTo: 'material/chart/line', pathMatch: 'full' },
56+
{ path: '**', redirectTo: 'material/chart/line' }
5657
];
5758

5859
@NgModule({

styles/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,9 @@ propertye pane
11361136
.control-section {
11371137
min-height: 150px;
11381138
}
1139+
.e-sb-header-text>.sb-header-text-left {
1140+
display: none;
1141+
}
11391142
}
11401143

11411144
@media (max-width: 764px) {

0 commit comments

Comments
 (0)