mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-24 03:49:14 -05:00
playlist.js Click outside the "edit playlist name" box will end the
edit and send the new name to the server Fixed a positioning error when the page is scrolled
This commit is contained in:
parent
8b46f4f586
commit
3697dbd0aa
@ -83,7 +83,7 @@ var EditPlaylistName = {
|
||||
},
|
||||
show: function () {
|
||||
input = $('edit_playlist_name');
|
||||
input.style.top = RicoUtil.toViewportPosition(el).y+ 'px';
|
||||
input.style.top = RicoUtil.toDocumentPosition(el).y+ 'px';
|
||||
input.value = this.playlistName;
|
||||
input.style.display = 'block';
|
||||
Field.activate(input);
|
||||
@ -95,10 +95,20 @@ var EditPlaylistName = {
|
||||
GlobalEvents.removeListener(this);
|
||||
},
|
||||
response: function (request) {
|
||||
// Check that the save gave response 200 OK
|
||||
},
|
||||
click: function (e) {
|
||||
var x = Event.pointerX(e);
|
||||
var y = Event.pointerY(e);
|
||||
var el = $('edit_playlist_name');
|
||||
var pos = RicoUtil.toViewportPosition(el);
|
||||
if ((x > pos.x) && (x < pos.x + el.offsetWidth) &&
|
||||
(y > pos.y) && (y < pos.y + el.offsetHeight)) {
|
||||
// Click was in input box
|
||||
return;
|
||||
}
|
||||
if (EditPlaylistName.playlistId) {
|
||||
// EditPlaylistName.save();
|
||||
EditPlaylistName.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user