didn't mean to commit some changes in aspect-edit.js

This commit is contained in:
Dan Hansen 2011-01-14 14:57:26 -06:00
parent d4f30ded1b
commit 8103e66ea3

View file

@ -93,7 +93,7 @@ var AspectEdit = {
var person_id = person.attr('data-guid');
if( $(".person[data-guid='"+ person_id +"']").length == 1) {
Diaspora.widgets.alert.alert("Error removing aspect", "You cannot remove the person from the last aspect");
Diaspora.widgets.alert.alert("Error removing contact", "You cannot remove the person from the last aspect");
} else {
if (!person.hasClass('request')) {
@ -118,28 +118,25 @@ var AspectEdit = {
link = "/aspects/" + id;
$this.keyup(function(e) {
e.preventDefault();
$this.keyup(function() {
if (e.which == 13) {
e.preventDefault();
$this.blur();
//save changes
$.ajax({
type: "PUT",
url: link,
data: {
"aspect": {
"name" : $this.text()
}
}
});
}
//update all other aspect links
$("#aspect_nav li[data-guid='" + id + "'] a").text($this.text());
if(e.keyCode === 13) {
$this.trigger("blur");
}
});
$this.blur(function() {
//save changes
$.ajax({
type: "PUT",
url: link,
data: {
"aspect": {
"name" : $this.text()
}
}
});
});
},