Commit b1027f85 by E. Kolpakov

Fix for issue #15

parent d3cf58ab
function PollEditUtil(runtime, element, pollType) { function PollEditUtil(runtime, element, pollType) {
var self = this; var self = this;
var notify; var notify;
...@@ -105,14 +104,15 @@ function PollEditUtil(runtime, element, pollType) { ...@@ -105,14 +104,15 @@ function PollEditUtil(runtime, element, pollType) {
this.empowerArrows = function(scope, topMarker, bottomMarker) { this.empowerArrows = function(scope, topMarker, bottomMarker) {
// Activates the arrows on rendered line items. // Activates the arrows on rendered line items.
$('.poll-move-up', scope).click(function () { $('.poll-move-up', scope).click(function (ev) {
var tag = $(this).parents('li'); var tag = $(this).parents('li');
if (tag.index() <= ($(topMarker).index() + 1)){ if (tag.index() <= ($(topMarker).index() + 1)){
return; return;
} }
tag.prev().before(tag); tag.prev().before(tag);
tag.fadeOut(0).fadeIn('slow', 'swing'); tag.fadeOut(0).fadeIn('slow', 'swing');
self.scrollTo(tag) self.scrollTo(tag);
ev.preventDefault();
}); });
$('.poll-move-down', scope).click(function () { $('.poll-move-down', scope).click(function () {
var tag = $(this).parents('li'); var tag = $(this).parents('li');
...@@ -121,7 +121,8 @@ function PollEditUtil(runtime, element, pollType) { ...@@ -121,7 +121,8 @@ function PollEditUtil(runtime, element, pollType) {
} }
tag.next().after(tag); tag.next().after(tag);
tag.fadeOut(0).fadeIn('slow', 'swing'); tag.fadeOut(0).fadeIn('slow', 'swing');
self.scrollTo(tag) self.scrollTo(tag);
ev.preventDefault();
}); });
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment