Bläddra i källkod

fixes for new unfocus code

Adam Shaw 7 år sedan
förälder
incheckning
b47030ef58
3 ändrade filer med 4 tillägg och 9 borttagningar
  1. 3 3
      src/Calendar.ts
  2. 1 3
      src/interactions/DateSelecting.ts
  3. 0 3
      tests/automated/hacks.js

+ 3 - 3
src/Calendar.ts

@@ -1034,9 +1034,9 @@ export default class Calendar {
 
 
 
 
   // public method
   // public method
-  unselect(ev?: UIEvent) {
+  unselect(pev?: PointerDragEvent) {
     this.dispatch({ type: 'UNSELECT_DATES' })
     this.dispatch({ type: 'UNSELECT_DATES' })
-    this.triggerDateUnselect()
+    this.triggerDateUnselect(pev)
   }
   }
 
 
 
 
@@ -1094,7 +1094,7 @@ export default class Calendar {
         let unselectCancel = view.opt('unselectCancel')
         let unselectCancel = view.opt('unselectCancel')
 
 
         if (unselectAuto && (!unselectAuto || !elementClosest(documentPointer.downEl, unselectCancel))) {
         if (unselectAuto && (!unselectAuto || !elementClosest(documentPointer.downEl, unselectCancel))) {
-          this.unselect(pev.origEvent)
+          this.unselect(pev)
         }
         }
       }
       }
 
 

+ 1 - 3
src/interactions/DateSelecting.ts

@@ -48,9 +48,7 @@ export default class DateSelecting {
   }
   }
 
 
   handleDragStart = (ev: PointerDragEvent) => {
   handleDragStart = (ev: PointerDragEvent) => {
-    // unselect previous (just trigger the handlers)
-    // will render previous selection in handleHitUpdate
-    this.component.getCalendar().triggerDateUnselect()
+    this.component.getCalendar().unselect(ev) // unselect previous selections
   }
   }
 
 
   handleHitUpdate = (hit: Hit | null, isFinal: boolean) => {
   handleHitUpdate = (hit: Hit | null, isFinal: boolean) => {

+ 0 - 3
tests/automated/hacks.js

@@ -1,9 +1,6 @@
 
 
 beforeEach(function() {
 beforeEach(function() {
 
 
-  // HACK. PhantomJS fails otherwise
-  FullCalendar.Calendar.defaults.windowResizeDelay = 200
-
   // On real devices, when a click-like touch interaction happens, there is a preiod of time where mouse events
   // On real devices, when a click-like touch interaction happens, there is a preiod of time where mouse events
   // are ignores. Since ignore peroid is global, and might span across tests, disable it.
   // are ignores. Since ignore peroid is global, and might span across tests, disable it.
   // The simulates touch events do not fire these mouse events anyway.
   // The simulates touch events do not fire these mouse events anyway.