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
|
|
@ -42,12 +42,16 @@ div ul li{
|
|||
margin: 0 3px 3px 3px;
|
||||
padding: 0.4em;
|
||||
padding-left: 1.5em;
|
||||
width: 75%;
|
||||
width: 95%;
|
||||
height: 18px;
|
||||
border: 2px outset rgb(255,228,196);
|
||||
background-color: rgb(245,245,220);
|
||||
}
|
||||
|
||||
.righty {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.entry span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
2
todo.txt
2
todo.txt
|
|
@ -22,7 +22,7 @@ x 2014-04-16 @EDITOR edit item saves data routine
|
|||
@EDITOR fix filenames
|
||||
@EDITOR dump to screen or file, not to console when saving
|
||||
@EDITOR delete an entry
|
||||
@EDITOR BUGFIX - ansi/ascii toggle/saving
|
||||
x 2014-04-17 @EDITOR BUGFIX - ansi/ascii toggle/saving
|
||||
(A) - parse files for 'info' @EDITOR @SAUCE
|
||||
|
||||
x 2014-03-24 (B) Get with dfox on the partymeister package version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue