From 4ccf51b3d35fa41be16fbc39d327efae0d6025f2 Mon Sep 17 00:00:00 2001 From: Dan Hansen Date: Fri, 14 Jan 2011 13:29:55 -0600 Subject: [PATCH] fix real time aspect name changing --- public/javascripts/aspect-edit.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index cdd390979..7ffa6ad64 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -113,9 +113,10 @@ var AspectEdit = { }, changeName: function() { - var $this = $(this); - var id = $this.closest(".aspect").attr("data-guid"); - var link = "/aspects/" + id; + var $this = $(this), + id = $this.closest(".aspect").attr("data-guid"), + link = "/aspects/" + id; + $this.keypress(function(e) { if (e.which == 13) { @@ -133,9 +134,11 @@ var AspectEdit = { } }); } + + //update all other aspect links $this.keyup(function(e) { - $("#aspect_nav a[href='" + link + "']").text($this.text()); + $("#aspect_nav li[data-guid='" + id + "'] a").text($this.text()); }); }); },