Skip to content

Commit

Permalink
bug(ej2-3079): fixed plunkr loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pipeline committed Aug 3, 2017
1 parent 59ae9c2 commit 01cb848
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function addRoutes(samplesList: Controls[]): void {
addRoute(urlString, () => {
let controlID: string = node.uid;
let sampleID: string = subNode.uid;
document.getElementById('plnkr').classList.add('disabled');
select('#switch').classList.remove('hidden');
document.getElementById('source-panel').style.display = 'block';
let ajaxHTML: Ajax = new Ajax('src/' + control + '/' + sample + '.html', 'GET', true);
Expand All @@ -285,11 +286,13 @@ function addRoutes(samplesList: Controls[]): void {
hljs.highlightBlock(document.getElementById('ts-source'));
});
let plunk: Ajax = new Ajax('src/' + control + '/' + sample + '-plnkr.json', 'GET', true);
let p3: Promise<Ajax> = plunk.send();
plunk.send().then((value: Object): void => {
plunker(<string>value);
document.getElementById('plnkr').classList.remove('disabled');
});
Promise.all([
p1,
p2,
p3,
p2
]).then((results: Object[]): void => {
let htmlString: string = results[0].toString();
destroyControls();
Expand Down Expand Up @@ -342,8 +345,9 @@ function addRoutes(samplesList: Controls[]): void {
document.body.classList.remove('sb-overlay');
select('#source-panel').classList.remove('hidden');
isExternalNavigation = defaultTree = false;
plunker(<string>results[2]);
});
}).catch((): void => {
location.reload();
});
});
}
}
Expand Down

0 comments on commit 01cb848

Please sign in to comment.