fix real time aspect name changing

This commit is contained in:
Dan Hansen 2011-01-14 13:29:55 -06:00
parent 3f7b89ac86
commit 4ccf51b3d3

View file

@ -113,9 +113,10 @@ var AspectEdit = {
}, },
changeName: function() { changeName: function() {
var $this = $(this); var $this = $(this),
var id = $this.closest(".aspect").attr("data-guid"); id = $this.closest(".aspect").attr("data-guid"),
var link = "/aspects/" + id; link = "/aspects/" + id;
$this.keypress(function(e) { $this.keypress(function(e) {
if (e.which == 13) { if (e.which == 13) {
@ -133,9 +134,11 @@ var AspectEdit = {
} }
}); });
} }
//update all other aspect links //update all other aspect links
$this.keyup(function(e) { $this.keyup(function(e) {
$("#aspect_nav a[href='" + link + "']").text($this.text()); $("#aspect_nav li[data-guid='" + id + "'] a").text($this.text());
}); });
}); });
}, },