From: Marcin Koziej Date: Fri, 8 Feb 2013 13:34:37 +0000 (+0100) Subject: fix hadnles X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/7edcc61e9599f75b6ce89c75a99ce1f7724499b9?hp=-c fix hadnles --- 7edcc61e9599f75b6ce89c75a99ce1f7724499b9 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(); }); };