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.
  • Loading branch information
pardo-bsso committed Mar 28, 2013
1 parent 12b52e1 commit f02f460
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 @@ -74,6 +74,10 @@ window.MediaListView2 = function(options){
_this.editingName(false);
}

this.removeItem = function (item) {
_this.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 @@ -60,6 +60,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

0 comments on commit f02f460

Please sign in to comment.