Skip to content

Commit

Permalink
Merge pull request #189 from open-craft/chris/FAL-4041-fix-prevent-de…
Browse files Browse the repository at this point in the history
…fault

* 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
  • Loading branch information
ChrisChV authored Feb 13, 2025
2 parents dc764eb + b79480b commit 3f1fdef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion poll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@

from .poll import PollBlock, SurveyBlock

__version__ = "1.14.0"
__version__ = "1.14.1"
6 changes: 3 additions & 3 deletions poll/public/js/poll_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,24 @@ function PollEditUtil(runtime, element, pollType) {
this.empowerArrows = function(scope, topMarker, bottomMarker) {
// Activates the arrows on rendered line items.
$('.poll-move-up', scope).click(function (ev) {
ev.preventDefault();
var tag = $(this).parents('li');
if (tag.index() <= ($(topMarker).index() + 1)){
return;
}
tag.prev().before(tag);
tag.fadeOut(0).fadeIn('slow', 'swing');
self.scrollTo(tag);
ev.preventDefault();
});
$('.poll-move-down', scope).click(function () {
$('.poll-move-down', scope).click(function (ev) {
ev.preventDefault();
var tag = $(this).parents('li');
if ((tag.index() >= ($(bottomMarker).index() - 1))) {
return;
}
tag.next().after(tag);
tag.fadeOut(0).fadeIn('slow', 'swing');
self.scrollTo(tag);
ev.preventDefault();
});
};

Expand Down

0 comments on commit 3f1fdef

Please sign in to comment.