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 24c0dc5 commit ce5de4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/server/public/scripts/modules/EditorJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ export default class Json {
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 src/server/public/scripts/modules/EditorSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ export default class EditorSave {
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 ce5de4c

Please sign in to comment.