Exercise: Fix missing hotspots when clicked in a previous hot spot - refs GH#2813
pull/4575/head
Yannick Warnier 3 years ago committed by GitHub
commit b42fa48749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      public/main/inc/lib/javascript/hotspot/js/hotspot.js

@ -913,13 +913,6 @@ window.HotspotQuestion = (function () {
self.answersCollection.get(answerIndex).set('x', point.x); self.answersCollection.get(answerIndex).set('x', point.x);
self.answersCollection.get(answerIndex).set('y', point.y); self.answersCollection.get(answerIndex).set('y', point.y);
})
.on('mouseup', function (e) {
if (!isMoving) {
return;
}
e.preventDefault();
$('[name="hotspot[' + config.questionId + '][' + hotspot.id + ']"]').val(function () { $('[name="hotspot[' + config.questionId + '][' + hotspot.id + ']"]').val(function () {
return [point.x, point.y].join(';'); return [point.x, point.y].join(';');
@ -927,6 +920,12 @@ window.HotspotQuestion = (function () {
$('[name="choice[' + config.questionId + '][' + hotspot.id + ']"]').val(function () { $('[name="choice[' + config.questionId + '][' + hotspot.id + ']"]').val(function () {
return [point.x, point.y].join(';'); return [point.x, point.y].join(';');
}); });
})
.on('mouseup', function (e) {
e.preventDefault();
if (!isMoving) {
return;
}
isMoving = false; isMoving = false;
}); });

Loading…
Cancel
Save