From b130359b2adfef17da7cc477779a4b98cecadd49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 7 Aug 2014 16:16:42 +0200 Subject: [PATCH] editor: finalizing exercise.order drag & drop mechanism --- src/editor/plugins/core/edumed/order/order.less | 11 +++++------ src/editor/plugins/core/edumed/order/view.js | 3 ++- src/editor/plugins/core/edumed/order/viewItem.html | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) 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 -- 2.20.1