fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e9cf500
)
editor: finalizing exercise.order drag & drop mechanism
author
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 7 Aug 2014 14:16:42 +0000
(16:16 +0200)
committer
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 14 Aug 2014 14:26:14 +0000
(16:26 +0200)
src/editor/plugins/core/edumed/order/order.less
patch
|
blob
|
history
src/editor/plugins/core/edumed/order/view.js
patch
|
blob
|
history
src/editor/plugins/core/edumed/order/viewItem.html
patch
|
blob
|
history
diff --git
a/src/editor/plugins/core/edumed/order/order.less
b/src/editor/plugins/core/edumed/order/order.less
index
67de8bc
..
e0c1b52
100644
(file)
--- 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;
width: 100%;
border-radius: 5px;
background-color: #ddd;
- -webkit-margin-before: -20px; // compensate for Chrome behavior for ol > li > table
}
.content {
}
.content {
@@
-34,7
+33,6
@@
text-align: center;
border-radius: 0 5px 5px 0;
padding: 10px 10px;
text-align: center;
border-radius: 0 5px 5px 0;
padding: 10px 10px;
- pointer-events: none;
.dragEnter {
opacity: 0.5;
.dragEnter {
opacity: 0.5;
@@
-54,11
+52,12
@@
width:100%;
}
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;
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
(file)
--- 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');
this.trigger(this.mode === 'initial' ? 'moveItem' : 'moveAnswer', droppedItem.item, first.item, 'before');
dropTargets.removeClass('active');
+ e.preventDefault();
}.bind(this));
};
_.extend(OrderExerciseView.prototype, Backbone.Events, {
}.bind(this));
};
_.extend(OrderExerciseView.prototype, Backbone.Events, {
@@
-150,7
+151,7
@@
var ItemView = function(item, exerciseView) {
var dropTargets = this.dom.find('.placeholder'),
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');
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
(file)
--- a/
src/editor/plugins/core/edumed/order/viewItem.html
+++ b/
src/editor/plugins/core/edumed/order/viewItem.html
@@
-1,9
+1,9
@@
<li>
<li>
- <div class="wrapper" draggable="true">
- <div class="content"></div>
- <div class="handle">
+ <div class="wrapper">
+ <div class="handle" draggable="true">
<i class="icon-resize-vertical icon-white"></i>
</div>
<i class="icon-resize-vertical icon-white"></i>
</div>
+ <div class="content"></div>
</div>
<div class="placeholder"></div>
</li>
\ No newline at end of file
</div>
<div class="placeholder"></div>
</li>
\ No newline at end of file