|
|
@@ -103,7 +103,7 @@ $(document).ready(function() {
|
|
|
.then(() => loadAsync(serverPath + '/contenu.html', 'text'))
|
|
|
.then(html => {
|
|
|
$editorHtml.html(html);
|
|
|
- $htmlContent.html(html);
|
|
|
+ setHtmlContent(html);
|
|
|
setActiveTab('html');
|
|
|
setCurrentHash(exampleSlug);
|
|
|
var sources = {
|
|
|
@@ -144,8 +144,9 @@ $(document).ready(function() {
|
|
|
else {
|
|
|
// console.log('I did restore', restoredDraft);
|
|
|
$editorHtml.html(restoredDraft.sources.html);
|
|
|
- $htmlContent.html(restoredDraft.sources.html);
|
|
|
+ setHtmlContent(restoredDraft.sources.html);
|
|
|
$editorJs.html(restoredDraft.sources.javascript);
|
|
|
+ loadJS('exemples/' + item.slug + '/script.js');
|
|
|
setActiveTab('html');
|
|
|
}
|
|
|
}
|
|
|
@@ -153,6 +154,11 @@ $(document).ready(function() {
|
|
|
}, 'json');
|
|
|
}
|
|
|
|
|
|
+ function setHtmlContent(html) {
|
|
|
+ $htmlContent.empty();
|
|
|
+ $htmlContent.html(html);
|
|
|
+ }
|
|
|
+
|
|
|
function notify(type, text) {
|
|
|
$notification
|
|
|
.addClass(type)
|