Skip to content

Commit

Permalink
Adds a delete button to playlist editor.
Browse files Browse the repository at this point in the history
See #36 y #37. It needs a better look.
(cherry picked from commit 2c6a226)
  • Loading branch information
pardo-bsso committed Apr 3, 2013
1 parent 6e9e0c7 commit 7369465
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public/js/views/medialist.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ window.MediaListView2 = function(options){
self.editingName(false);
}

this.removeItem = function (item) {
self.collection.remove(item);
}

this.filter = ko.observable('');
this.collection = kb.collectionObservable( model.get('collection'), {
view_model: kb.ViewModel,
Expand Down
2 changes: 2 additions & 0 deletions views/templates/medialist.jade
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ block content
a.plain(data-bind=target)
img(width="150",height="100",data-bind="attr:{ src: checksum() ? 'sc/'+checksum().split('-')[0]+'.jpg' : '/pics/generic.jpg' }")
td
- if (is_playlist)
button.close.remove-media(type='button', data-bind='click: $root.removeItem, clickBubble: false') ×
h5(data-bind="text: name")
h5(data-bind="text: stat().name ? stat().name : file")
span.label.label-warning.format
Expand Down

1 comment on commit 7369465

@xaiki
Copy link
Member

@xaiki xaiki commented on 7369465 Apr 4, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

Please sign in to comment.