removed group name edit madness from javascript.
This commit is contained in:
parent
a15bf73287
commit
5812bbd1f1
1 changed files with 0 additions and 46 deletions
|
|
@ -24,54 +24,8 @@ $(document).ready(function(){
|
|||
$(".image_cycle img").load( function() {
|
||||
$(this).fadeIn("slow");
|
||||
});
|
||||
|
||||
|
||||
$(".edit_group_button").click(function() {
|
||||
|
||||
var element = $(this).closest("li").children(".group_name").children("a");
|
||||
var oldHTML = element.html();
|
||||
|
||||
var link = element.attr("href");
|
||||
|
||||
element.toggleClass("editing");
|
||||
|
||||
if( element.hasClass("editing") ) {
|
||||
element.attr("contentEditable", true);
|
||||
element.focus();
|
||||
|
||||
//remove newline action
|
||||
$(element).keypress(function(e) {
|
||||
if (e.which == 13) {
|
||||
e.preventDefault();
|
||||
element.attr("contentEditable", false);
|
||||
element.toggleClass("editing");
|
||||
element.blur();
|
||||
|
||||
//save changes
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
url: link,
|
||||
data: {"group" : {"name" : element.text() }}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//update all other group links
|
||||
$(element).keyup(function(e) {
|
||||
$("a[href='"+link+"']").not(element).text(element.text());
|
||||
});
|
||||
|
||||
} else {
|
||||
element.attr("contentEditable", false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});//end document ready
|
||||
|
||||
|
||||
|
||||
function pane_toggler_button( name ) {
|
||||
|
||||
$("#add_" + name + "_button").toggle(
|
||||
|
|
|
|||
Loading…
Reference in a new issue