Delete item - BUG: indexes set to ORIGINAL list.
This commit is contained in:
parent
e635fa3ae3
commit
7d3abacf02
3 changed files with 21 additions and 3 deletions
|
|
@ -157,10 +157,24 @@ insert it into the array at end position. A la the draggon-dropping.
|
|||
|
||||
|
||||
additem: (item,pos) ->
|
||||
entry = $("<li class='entry' id='#{item.file}'><span class='ui-icon ui-icon-arrowthick-2-n-s'></span>#{ansiorascii booltoint item.amiga} | #{item.author} : #{item.name} : #{item.file}</li>")
|
||||
entry = @.genentryline item,pos
|
||||
entry.dblclick =>
|
||||
@.editline item,pos
|
||||
|
||||
genentryline: (item,pos) ->
|
||||
arrows = "<span class='ui-icon ui-icon-arrowthick-2-n-s'></span>"
|
||||
amigastatus = ansiorascii booltoint item.amiga
|
||||
delbutton = $("<span class='righty' id=del-#{pos}>delete</span>")
|
||||
.click ((_this) ->
|
||||
(event) ->
|
||||
pos = @.id.replace "del-",""
|
||||
console.log _this.data.filedata.splice pos,1
|
||||
@.parentNode.remove()
|
||||
)(this)
|
||||
entry = $("<li class='entry' id='#{item.file}'>#{arrows}#{amigastatus} | #{item.author} : #{item.name} : #{item.file}</li>")
|
||||
entry.append delbutton
|
||||
|
||||
|
||||
save: ->
|
||||
pos = $("#entryindex").val()
|
||||
entry = @data.filedata[pos]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue