Просмотр исходного кода

revert some unbinding problems

Adam Shaw 7 лет назад
Родитель
Сommit
2c1d89a29d

+ 1 - 7
src/common/Popover.ts

@@ -38,7 +38,6 @@ export default class Popover {
   options: PopoverOptions
   el: HTMLElement // the container element for the popover. generated by this object
   margin: number = 10 // the space required between the popover and the edges of the scroll container
-  removeCloseListener: any
 
 
   constructor(options: PopoverOptions) {
@@ -84,7 +83,7 @@ export default class Popover {
     options.parentEl.appendChild(el)
 
     // when a click happens on anything inside with a 'fc-close' className, hide the popover
-    this.removeCloseListener = listenBySelector(el, 'click', '.fc-close', (ev) => {
+    listenBySelector(el, 'click', '.fc-close', (ev) => {
       this.hide()
     })
 
@@ -112,11 +111,6 @@ export default class Popover {
       this.el = null
     }
 
-    if (this.removeCloseListener) {
-      this.removeCloseListener()
-      this.removeCloseListener = null
-    }
-
     this.stopListeningTo(document, 'mousedown')
   }
 

+ 1 - 1
src/component/InteractiveDateComponent.ts

@@ -121,7 +121,7 @@ export default abstract class InteractiveDateComponent extends DateComponent {
 
 
   bindSegHandlerToEl(el, name, handler) {
-    return listenBySelector(
+    listenBySelector(
       el,
       name,
       this.segSelector,

+ 2 - 14
src/component/interactions/EventDragging.ts

@@ -12,8 +12,6 @@ export default class EventDragging extends Interaction {
   eventPointing: any
   dragListener: any
   isDragging: boolean = false
-  removeMouseDownHandler: any
-  removeTouchStartHandler: any
 
 
   /*
@@ -31,16 +29,6 @@ export default class EventDragging extends Interaction {
 
 
   end() {
-    if (this.removeMouseDownHandler) {
-      this.removeMouseDownHandler()
-      this.removeMouseDownHandler = null
-    }
-
-    if (this.removeTouchStartHandler) {
-      this.removeTouchStartHandler()
-      this.removeTouchStartHandler = null
-    }
-
     if (this.dragListener) {
       this.dragListener.endInteraction()
     }
@@ -61,8 +49,8 @@ export default class EventDragging extends Interaction {
   bindToEl(el) {
     let component = this.component
 
-    this.removeMouseDownHandler = component.bindSegHandlerToEl(el, 'mousedown', this.handleMousedown.bind(this))
-    this.removeTouchStartHandler = component.bindSegHandlerToEl(el, 'touchstart', this.handleTouchStart.bind(this))
+    component.bindSegHandlerToEl(el, 'mousedown', this.handleMousedown.bind(this))
+    component.bindSegHandlerToEl(el, 'touchstart', this.handleTouchStart.bind(this))
   }