From: Aleksander Ɓukasz Date: Thu, 7 Aug 2014 14:16:42 +0000 (+0200) Subject: editor: finalizing exercise.order drag & drop mechanism X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/b130359b2adfef17da7cc477779a4b98cecadd49?hp=e9cf500f44f691af0d5529ebbef61c20059955c8 editor: finalizing exercise.order drag & drop mechanism --- diff --git a/src/editor/plugins/core/edumed/order/order.less b/src/editor/plugins/core/edumed/order/order.less index 67de8bc..e0c1b52 100644 --- a/src/editor/plugins/core/edumed/order/order.less +++ b/src/editor/plugins/core/edumed/order/order.less @@ -12,7 +12,6 @@ width: 100%; border-radius: 5px; background-color: #ddd; - -webkit-margin-before: -20px; // compensate for Chrome behavior for ol > li > table } .content { @@ -34,7 +33,6 @@ text-align: center; border-radius: 0 5px 5px 0; padding: 10px 10px; - pointer-events: none; .dragEnter { opacity: 0.5; @@ -54,11 +52,12 @@ width:100%; } - .placeholder-top { - margin-left: 25px; + ol { + margin: 0; + counter-reset: edumed-order-counter; } - - li { + ol li { + list-style-type: none; cursor: move; .dragged { opacity: 0.6; diff --git a/src/editor/plugins/core/edumed/order/view.js b/src/editor/plugins/core/edumed/order/view.js index 8905e7a..a90ded4 100644 --- a/src/editor/plugins/core/edumed/order/view.js +++ b/src/editor/plugins/core/edumed/order/view.js @@ -82,6 +82,7 @@ var OrderExerciseView = function(element) { this.trigger(this.mode === 'initial' ? 'moveItem' : 'moveAnswer', droppedItem.item, first.item, 'before'); dropTargets.removeClass('active'); + e.preventDefault(); }.bind(this)); }; _.extend(OrderExerciseView.prototype, Backbone.Events, { @@ -150,7 +151,7 @@ var ItemView = function(item, exerciseView) { var dropTargets = this.dom.find('.placeholder'), - dragSources = this.dom.find('.wrapper'); + dragSources = this.dom.find('.handle'); dragSources.on('dragstart', function(e) { this.dom.addClass('dragged'); diff --git a/src/editor/plugins/core/edumed/order/viewItem.html b/src/editor/plugins/core/edumed/order/viewItem.html index 1e9b1b1..33e242a 100644 --- a/src/editor/plugins/core/edumed/order/viewItem.html +++ b/src/editor/plugins/core/edumed/order/viewItem.html @@ -1,9 +1,9 @@
  • -
    -
    -
    +
    +
    +
  • \ No newline at end of file