CC-1883 pressing enter now takes entered data.
This commit is contained in:
parent
108bf65930
commit
d15019c168
|
@ -334,9 +334,9 @@ function newSPL() {
|
||||||
url = '/Playlist/new/format/json';
|
url = '/Playlist/new/format/json';
|
||||||
|
|
||||||
$.post(url, function(json){
|
$.post(url, function(json){
|
||||||
var submit;
|
var submit, form;
|
||||||
|
|
||||||
submit = $('<button>Submit</button>')
|
submit = $('<button id="new_playlist_submit">Submit</button>')
|
||||||
.button()
|
.button()
|
||||||
.click(function(){
|
.click(function(){
|
||||||
var url, data;
|
var url, data;
|
||||||
|
@ -353,9 +353,20 @@ function newSPL() {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
form = $(json.form);
|
||||||
|
|
||||||
|
form.find("input, description")
|
||||||
|
.keydown(function(event){
|
||||||
|
//enter was pressed
|
||||||
|
if(event.keyCode === 13) {
|
||||||
|
event.preventDefault();
|
||||||
|
$("#new_playlist_submit").click();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$("#side_playlist")
|
$("#side_playlist")
|
||||||
.empty()
|
.empty()
|
||||||
.append(json.form)
|
.append(form)
|
||||||
.append(submit);
|
.append(submit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue