From: Marcin Koziej Date: Fri, 8 Feb 2013 13:28:29 +0000 (+0100) Subject: isnert li when dragging handles X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/3e4d96cd7fdd08910887be91ead79e446a96fe53?hp=2a6726356f43599014a74540c23115a3f2a61a0e isnert li when dragging handles --- diff --git a/lib/librarian b/lib/librarian index 11d86305..f921a036 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit 11d863057b43462248572daed7c8fc698d573b3d +Subproject commit f921a036ff55ff3a43ad2c93c8d8eb808fd54724 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(); }); };