From 29a600fe87a8d61d0287a37fab3601b1f116d702 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Mon, 21 Nov 2011 10:01:33 -0500 Subject: [PATCH] Fix ^n bug while editing --- TODO | 1 - static/application.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index a674fd2..7cb830d 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ maximum size of a haste fix any annoying visual quirks add FAVICON cache static in memory -bug in ^n while editing # shared version only some way to do announcements easily (and use for ads) diff --git a/static/application.js b/static/application.js index 31ba0cc..e424489 100644 --- a/static/application.js +++ b/static/application.js @@ -101,7 +101,7 @@ haste.prototype.newDocument = function(hideHistory) { } this.setTitle(); this.lightKey(); - this.$textarea.show('fast', function() { + this.$textarea.val('').show('fast', function() { this.focus(); }); }; @@ -170,7 +170,7 @@ haste.prototype.configureShortcuts = function() { // ^N for new document else if (evt.ctrlKey && evt.keyCode === 78) { evt.preventDefault(); - _this.newDocument(); + _this.newDocument(!_this.doc.key); } // ^D for duplicate - only when locked else if (_this.doc.locked && evt.ctrlKey && evt.keyCode === 68) {