From 7edcc61e9599f75b6ce89c75a99ce1f7724499b9 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Fri, 8 Feb 2013 14:34:37 +0100 Subject: [PATCH] fix hadnles --- lib/librarian | 2 +- redakcja/static/edumed/js/edumed.coffee | 9 ++++++++- redakcja/static/edumed/js/edumed.js | 8 +++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/librarian b/lib/librarian index 1ffcf32a..a1e43b7b 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit 1ffcf32a8d795681f54bd125ca45e908da5ed3fb +Subproject commit a1e43b7bba2a0c7cf33280143bb49af3fef5d0d0 diff --git a/redakcja/static/edumed/js/edumed.coffee b/redakcja/static/edumed/js/edumed.coffee index 14c700ce..59430a29 100644 --- a/redakcja/static/edumed/js/edumed.coffee +++ b/redakcja/static/edumed/js/edumed.coffee @@ -116,13 +116,20 @@ class Exercise extends Binding $placeholder.after($added) if not $placeholder.hasClass('multiple') $placeholder.hide() + if $added.is(".add-li") + $added.wrap("
  • ") + $added.append('x') $('.remove', $added).click (ev) => - $added.prev(".placeholder:not(.multiple)").show() if not ismultiple $($added.data('original')).removeClass('disabled').draggable('enable') + + if $added.is(".add-li") + $added = $added.closest('li') + $added.prev(".placeholder:not(.multiple)").show() $added.remove() + ## XXX co z issortable? dragging: (ismultiple, issortable) -> $(".question", @element).each (i, question) => diff --git a/redakcja/static/edumed/js/edumed.js b/redakcja/static/edumed/js/edumed.js index cc7b9e12..e3878be5 100644 --- a/redakcja/static/edumed/js/edumed.js +++ b/redakcja/static/edumed/js/edumed.js @@ -152,12 +152,18 @@ if (!$placeholder.hasClass('multiple')) { $placeholder.hide(); } + if ($added.is(".add-li")) { + $added.wrap("
  • "); + } $added.append('x'); return $('.remove', $added).click(function(ev) { - $added.prev(".placeholder:not(.multiple)").show(); if (!ismultiple) { $($added.data('original')).removeClass('disabled').draggable('enable'); } + if ($added.is(".add-li")) { + $added = $added.closest('li'); + } + $added.prev(".placeholder:not(.multiple)").show(); return $added.remove(); }); }; -- 2.20.1