this.item = this.activeScreen.find(".list-item")
this.zone1 = this.activeScreen.find(".zone-1 .zone-content")
this.zone2 = this.activeScreen.find(".zone-2 .zone-content")
+
this.htmlZone1 = this.zone1.html()
this.htmlZone2 = this.zone2.html()
this.offsetLeftItemDragged = 0
this.offsetRightItemDragged = 0
-
this.initQuestion();
},
position: 'absolute',
}
if (this.quiz.resize.isMobile()) {
+
rules = {
scale: 0.8, duration: .3, autoAlpha: 0,
}
return zone
},
- getSlotInformations: function (zone) {
+ measureSizes: function () {
+ this.ww = $(window).width();
+ this.hh = $(window).height();
+ this.ratio = this.ww / this.hh;
+ return this.ratio
+ },
+
+ getSlotInformations: function (zone) {
let a = this.getAreaElement(zone);
let freeSlot = $(a).find('.slot:not(.active)').eq(0);
let freeSlotRect = $(freeSlot).get(0).getBoundingClientRect();
let listRect = this.list.get(0).getBoundingClientRect();
+ let scale = this.quiz.resize.scale
- let x = (freeSlotRect.left - listRect.left), y = (freeSlotRect.top - listRect.top),
+ let x = (freeSlotRect.x - listRect.x), y = (freeSlotRect.top - listRect.top),
w = freeSlotRect.width, h = freeSlotRect.height, el = $(a).find(".slot")
- return {"x": x, "y": y, "w": w, "h": h, "el": el}
+ return {"x": Math.round(x / scale), "y": Math.round(y / scale), "w": w / scale, "h": h / scale, "el": el}
},
getAreaElement: function (area) {