X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/63fa9213819e7006cd1ced0c690dad76f990ec60..b2c05060cee75fc1b6902e08c706ca369a37e1ab:/redakcja/static/edumed/js/edumed.js 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(); }); };