]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wip #6182 @0:20 question drag and drop
authorsoufiane <soufiane@cubedesigners.com>
Thu, 14 Sep 2023 16:25:33 +0000 (18:25 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 14 Sep 2023 16:25:33 +0000 (18:25 +0200)
js/quiz.draganddrop.js
style/106-question-draganddrop.sass
views/screens/question_draganddrop.blade.php

index fc984bff61efdb49590f2ff7ac7b10ba1f180dfd..ad93de26e941c9af4e05c8059ab7b3e59ddfd046 100644 (file)
@@ -64,6 +64,7 @@ QuizDragAndDrop.prototype = {
             bounds: "#quiz",
             onDragParams: [{}],
             onDrag: function() {
+                $(".zone-1,.zone-2").removeClass("notDrag")
                 $(this.target).addClass("isDragging").removeClass("isNext")
 
                 $this.offsetLeftItemDragged = $(this.target).offset().left
@@ -133,6 +134,9 @@ QuizDragAndDrop.prototype = {
                 }
             },
             onRelease: function() {
+                //
+                $(".zone-1,.zone-2").addClass("notDrag")
+
                 //
                 $this.leaveZone()
 
@@ -181,7 +185,7 @@ QuizDragAndDrop.prototype = {
     },
 
     leaveZone: function() {
-        $(".zone-1,.zone-2").removeClass("active")
+        $(".zone-1,.zone-2").removeClass("active").removeClass("isDragging")
     },
 
     slapping: function(zone,target) {
index b2c86806fce3c17eed0d17901be0187020b6ef0a..6f840f32f575dc56e7fe1befae6f45da53b318e5 100644 (file)
                 height: auto
                 left: 50%
                 transform: translateX(-50%)
-                padding: 10px 40px
+                padding: 18px 40px
                 border-radius: 8px
                 border-width: 2px
                 .text
                     +opacity(.8,color,$texts-color)
             .slot
                 display: none
+
+            &.notDrag
+                .zone-content
+                    border-color: transparent
+
             &.zone-1
                 width: 100%
                 height: auto
index afd64fa21e5bde780d43b4ab972bad06d71690d2..e712e91c2caca6c354129f132952d39b87785ad4 100644 (file)
@@ -1,5 +1,5 @@
 <div class="container-screen none question-draganddrop" data-screen="q-{{$position}}">
-    <div class="screen-image zone-1">
+    <div class="screen-image zone-1 notDrag">
         <img src="{{$theme->draganddropArea1Image}}" />
         <img class="mobile" src="{{$theme->draganddropArea1ImageMobile}}"/>
         <div class="zone-content">
@@ -36,7 +36,7 @@
             <button class="access move-card" aria-keyshortcuts="ARROWRIGHT"><span data-icon="arrow"></span></button>
         </div>
     </div>
-    <div class="screen-image zone-2">
+    <div class="screen-image zone-2 notDrag">
         <img src="{{$theme->draganddropArea2Image}}" />
         <img class="mobile" src="{{$theme->draganddropArea2ImageMobile}}"/>
         <div class="zone-content">