Skip to content

Commit

Permalink
if empty template build
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Aug 3, 2016
1 parent b2c996d commit ab95873
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 15 deletions.
29 changes: 15 additions & 14 deletions dist/server/public/scripts/modules/EditorReload.js
Expand Up @@ -87,20 +87,21 @@ var Reload = function () {
body: data,
method: 'post'
}, function (code, responseText, request) {

var str = responseText;
var doc = iframe.contentWindow.document;
str = str.replace(/<\/head>/, '<base href="/" /></head>');
doc.open();
doc.write(str);
doc.close();

setTimeout(function () {
var iframeDoc = (0, _iframe.IframeDocument)('#page-template');
if (typeof iframeDoc !== 'undefined' && iframeDoc !== null && typeof iframeDoc.body !== 'undefined' && iframeDoc.body !== null) {
iframeDoc.body.scrollTop = scrollTop;
}
}, 1000);
if (typeof responseText !== 'undefined' && responseText !== null) {
var str = responseText;
var doc = iframe.contentWindow.document;
str = str.replace(/<\/head>/, '<base href="/" /></head>');
doc.open();
doc.write(str);
doc.close();

setTimeout(function () {
var iframeDoc = (0, _iframe.IframeDocument)('#page-template');
if (typeof iframeDoc !== 'undefined' && iframeDoc !== null && typeof iframeDoc.body !== 'undefined' && iframeDoc.body !== null) {
iframeDoc.body.scrollTop = scrollTop;
}
}, 1000);
}

return;
});
Expand Down

0 comments on commit ab95873

Please sign in to comment.