1
0
Fork 0
mirror of https://github.com/seejohnrun/haste-server.git synced 2024-11-01 03:21:21 +00:00

Push state on doc change

This commit is contained in:
John Crepezzi 2011-11-18 15:55:01 -05:00
parent 13e497993f
commit 44d54174ed
2 changed files with 4 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
npm-debug.log
node_modules
*.swp
*.swo

View file

@ -60,6 +60,7 @@ heist.prototype.newDocument = function(ext) {
this.doc = new heist_document();
this.$box.hide();
this.setTitle();
window.history.pushState(null, this.appName, '/');
this.$textarea.val('').show().focus();
}
@ -79,7 +80,7 @@ heist.prototype.lockDocument = function() {
if (ret) {
_this.$code.html(ret.value);
_this.setTitle(ret.language + '-' + ret.uuid);
// TODO add to push state
window.history.pushState(null, _this.appName + '-' + ret.uuid, '/' + ret.uuid);
_this.$textarea.val('').hide();
_this.$box.show();
}