From 7d3abacf02e93de332ad6e49da5dafbb6c0f8337 Mon Sep 17 00:00:00 2001 From: Howland Owl Date: Thu, 17 Apr 2014 15:08:26 +0300 Subject: [PATCH] Delete item - BUG: indexes set to ORIGINAL list. --- editor/sahliedit.css | 6 +++++- editor/sahliedit.litcoffee | 16 +++++++++++++++- todo.txt | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/editor/sahliedit.css b/editor/sahliedit.css index 20135bd..0789e87 100644 --- a/editor/sahliedit.css +++ b/editor/sahliedit.css @@ -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; } diff --git a/editor/sahliedit.litcoffee b/editor/sahliedit.litcoffee index 7d27e05..1788789 100644 --- a/editor/sahliedit.litcoffee +++ b/editor/sahliedit.litcoffee @@ -157,10 +157,24 @@ insert it into the array at end position. A la the draggon-dropping. additem: (item,pos) -> - entry = $("
  • #{ansiorascii booltoint item.amiga} | #{item.author} : #{item.name} : #{item.file}
  • ") + entry = @.genentryline item,pos entry.dblclick => @.editline item,pos + genentryline: (item,pos) -> + arrows = "" + amigastatus = ansiorascii booltoint item.amiga + delbutton = $("delete") + .click ((_this) -> + (event) -> + pos = @.id.replace "del-","" + console.log _this.data.filedata.splice pos,1 + @.parentNode.remove() + )(this) + entry = $("
  • #{arrows}#{amigastatus} | #{item.author} : #{item.name} : #{item.file}
  • ") + entry.append delbutton + + save: -> pos = $("#entryindex").val() entry = @data.filedata[pos] diff --git a/todo.txt b/todo.txt index 9b7d567..49b90c3 100644 --- a/todo.txt +++ b/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