Skip to content

Commit 01cb848

Browse files
author
pipeline
committed
bug(ej2-3079): fixed plunkr loading issue
1 parent 59ae9c2 commit 01cb848

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/common/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ function addRoutes(samplesList: Controls[]): void {
272272
addRoute(urlString, () => {
273273
let controlID: string = node.uid;
274274
let sampleID: string = subNode.uid;
275+
document.getElementById('plnkr').classList.add('disabled');
275276
select('#switch').classList.remove('hidden');
276277
document.getElementById('source-panel').style.display = 'block';
277278
let ajaxHTML: Ajax = new Ajax('src/' + control + '/' + sample + '.html', 'GET', true);
@@ -285,11 +286,13 @@ function addRoutes(samplesList: Controls[]): void {
285286
hljs.highlightBlock(document.getElementById('ts-source'));
286287
});
287288
let plunk: Ajax = new Ajax('src/' + control + '/' + sample + '-plnkr.json', 'GET', true);
288-
let p3: Promise<Ajax> = plunk.send();
289+
plunk.send().then((value: Object): void => {
290+
plunker(<string>value);
291+
document.getElementById('plnkr').classList.remove('disabled');
292+
});
289293
Promise.all([
290294
p1,
291-
p2,
292-
p3,
295+
p2
293296
]).then((results: Object[]): void => {
294297
let htmlString: string = results[0].toString();
295298
destroyControls();
@@ -342,8 +345,9 @@ function addRoutes(samplesList: Controls[]): void {
342345
document.body.classList.remove('sb-overlay');
343346
select('#source-panel').classList.remove('hidden');
344347
isExternalNavigation = defaultTree = false;
345-
plunker(<string>results[2]);
346-
});
348+
}).catch((): void => {
349+
location.reload();
350+
});
347351
});
348352
}
349353
}

0 commit comments

Comments
 (0)