Skip to content

Commit

Permalink
save with #hash
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Aug 16, 2016
1 parent ce5de4c commit ce00d34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions dist/server/public/scripts/modules/EditorJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@ var Json = function () {
return;
}
if (typeof jsonRes.reject !== 'undefined' && jsonRes.reject !== null) {
var hash = '';
if (typeof top.location.hash !== 'undefined' && top.location.hash !== null) {
hash = '#' + top.location.hash;
}

window.location.href = window.location.origin + window.location.pathname + '?filePath=' + jsonRes.reject + hash;
location.reload();
return;
}
_this.data = jsonRes.json;
Expand Down
5 changes: 3 additions & 2 deletions dist/server/public/scripts/modules/EditorSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,13 @@ var EditorSave = function () {
var ext = filePathParam.split('.');
ext = ext[ext.length - 1];
filePathParam = filePathParam.replace(new RegExp('-abe-(.+?)(?=\.' + ext + ')'), '');
var reloadUrl = top.location.protocol + '//' + window.location.host + window.location.pathname + tplNameParam + filePathParam;
var reloadUrl = top.location.protocol + '//' + window.location.host + window.location.pathname + tplNameParam + filePathParam + top.location.hash;

target.classList.remove('loading');
target.classList.remove('done');
target.removeAttribute('disabled');
if (result.success === 1) window.location.href = reloadUrl;

if (result.success === 1) location.reload();
}).catch(function (e) {
console.error(e);
});
Expand Down

0 comments on commit ce00d34

Please sign in to comment.