fix issue #4; fix issue #5

This commit is contained in:
bkfox
2017-05-04 16:58:54 +02:00
parent aff3476088
commit 89182f3c20
5 changed files with 51 additions and 6 deletions

View File

@ -76,7 +76,7 @@ a:hover > .small_icon {
/** page **/
.page > nav {
width: 16em;
width: 20em;
overflow: hidden;
}
@ -215,3 +215,10 @@ main.detail {
}
/** section: playlist **/
.playlist .title {
font-style: italic;
color: #616161;
}

View File

@ -81,7 +81,6 @@ Sound.prototype = {
}, false
);
item.addEventListener('click', function(event) {
if(event.target.className.indexOf('action') != -1)
return;
@ -119,7 +118,7 @@ Playlist.prototype = {
});
},
add: function(sound, container) {
add: function(sound, container, position) {
var sound_ = this.find(sound.streams);
if(sound_)
return sound_;
@ -128,9 +127,16 @@ Playlist.prototype = {
this.on_air = sound;
sound.make_item(this, this.item_);
(container || this.playlist).appendChild(sound.item);
this.sounds.push(sound);
container = container || this.playlist;
if(position != undefined) {
container.insertBefore(sound.item, container.children[position]);
this.sounds.insert(position, 0, sound.item);
}
else {
container.appendChild(sound.item);
this.sounds.push(sound);
}
this.save();
return sound;
},