This commit is contained in:
MrZYX 2011-04-06 14:18:33 +02:00
parent 21b5f7932f
commit 95de299e6e
2 changed files with 22 additions and 15 deletions

View file

@ -137,8 +137,6 @@ class AspectsController < ApplicationController
else
flash[:error] = I18n.t 'aspects.update.failure', :name => @aspect.name
end
respond_with @aspect
end
def toggle_contact_visibility

View file

@ -20,6 +20,7 @@ var AspectEdit = {
$("#manage_aspect_zones").find(".delete").live("click", AspectEdit.deletePerson);
$(".aspect h3").live('focus', AspectEdit.changeName);
},
startDrag: function() {
@ -116,12 +117,24 @@ var AspectEdit = {
id = $this.closest(".aspect").attr("data-guid"),
link = "/aspects/" + id;
//cleanup
$this.text($.trim($this.text()));
$this.keyup(function() {
$this.keypress(function(e) {
if (e.which == 13) {
e.preventDefault();
$this.blur();
}
//length limit
if ($this.text().length >= 20) {
e.preventDefault();
}
//update all other aspect links
$("#aspect_nav li[data-guid='" + id + "'] a").text($this.text());
});
$this.blur(function() {
//save changes
$.ajax({
type: "PUT",
@ -132,10 +145,6 @@ var AspectEdit = {
}
}
});
}
//update all other aspect links
$("#aspect_nav li[data-guid='" + id + "'] a").text($this.text());
});
},