Skip to content

Commit 3f1fdef

Browse files
authored
Merge pull request #189 from open-craft/chris/FAL-4041-fix-prevent-default
* Move the preventDefault function before the conditional in poll-move-up and poll-move-down click events. * This change is to avoid opening a new tab page when clicking the Move up/Move down buttons when the Poll block is in an Iframe
2 parents dc764eb + b79480b commit 3f1fdef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

poll/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323

2424
from .poll import PollBlock, SurveyBlock
2525

26-
__version__ = "1.14.0"
26+
__version__ = "1.14.1"

poll/public/js/poll_edit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,24 @@ function PollEditUtil(runtime, element, pollType) {
108108
this.empowerArrows = function(scope, topMarker, bottomMarker) {
109109
// Activates the arrows on rendered line items.
110110
$('.poll-move-up', scope).click(function (ev) {
111+
ev.preventDefault();
111112
var tag = $(this).parents('li');
112113
if (tag.index() <= ($(topMarker).index() + 1)){
113114
return;
114115
}
115116
tag.prev().before(tag);
116117
tag.fadeOut(0).fadeIn('slow', 'swing');
117118
self.scrollTo(tag);
118-
ev.preventDefault();
119119
});
120-
$('.poll-move-down', scope).click(function () {
120+
$('.poll-move-down', scope).click(function (ev) {
121+
ev.preventDefault();
121122
var tag = $(this).parents('li');
122123
if ((tag.index() >= ($(bottomMarker).index() - 1))) {
123124
return;
124125
}
125126
tag.next().after(tag);
126127
tag.fadeOut(0).fadeIn('slow', 'swing');
127128
self.scrollTo(tag);
128-
ev.preventDefault();
129129
});
130130
};
131131

0 commit comments

Comments
 (0)