From 44d54174ed8bff932f38c3afaac45dfd7eb36802 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Fri, 18 Nov 2011 15:55:01 -0500 Subject: [PATCH] Push state on doc change --- .gitignore | 2 ++ static/application.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0db216b..bb5fbe3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ npm-debug.log node_modules +*.swp +*.swo diff --git a/static/application.js b/static/application.js index 3d66d75..e16c3a6 100644 --- a/static/application.js +++ b/static/application.js @@ -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(); }