CC-3149: Playlist Builder, fix JS for editing title/description

This commit is contained in:
Naomi Aro 2011-12-02 17:49:48 +01:00
parent 966dd49610
commit 06cbe215a3
1 changed files with 23 additions and 15 deletions

View File

@ -364,7 +364,9 @@ function editName() {
$("#playlist_name_input") $("#playlist_name_input")
.removeClass('element_hidden') .removeClass('element_hidden')
.val(playlistName) .val(playlistName)
.blur(function(){ .keydown(function(event){
if(event.keyCode === 13) {
event.preventDefault();
var input = $(this); var input = $(this);
var url; var url;
url = '/Playlist/set-playlist-name'; url = '/Playlist/set-playlist-name';
@ -377,8 +379,8 @@ function editName() {
nameElement.text(json.playlistName); nameElement.text(json.playlistName);
redrawDataTablePage(); redrawDataTablePage();
}); });
}
}) })
.keydown(submitOnEnter)
.focus(); .focus();
} }
@ -441,9 +443,12 @@ function setUpSPL() {
$.post(url, {format: "json", description: description}, function(json){ $.post(url, {format: "json", description: description}, function(json){
if(json.playlist_error == true){ if(json.playlist_error == true){
alertPlaylistErrorAndReload(); alertPlaylistErrorAndReload();
}else{ }
else{
textarea.val(json.playlistDescription); textarea.val(json.playlistDescription);
} }
$("#fieldset-metadate_change").addClass("closed");
}); });
}); });
@ -455,9 +460,12 @@ function setUpSPL() {
$.post(url, {format: "json"}, function(json){ $.post(url, {format: "json"}, function(json){
if(json.playlist_error == true){ if(json.playlist_error == true){
alertPlaylistErrorAndReload(); alertPlaylistErrorAndReload();
}else{ }
else{
textarea.val(json.playlistDescription); textarea.val(json.playlistDescription);
} }
$("#fieldset-metadate_change").addClass("closed");
}); });
}); });