src/core/events.js
function(element, event, callback) {

    const eventStack = ChuiEventCache.elements[element.id]
    if (!eventStack) return
    let deleteOrder = []

    if (!event) {
      deleteOrder = []
      eventStack.forEach(function(evt, idx) {
        element.removeEventListener(evt.event, evt.callback, evt.capturePhase)
        deleteOrder.push(idx)
      })

      deleteFromEventStack(deleteOrder, eventStack)

    } else if (!!event && !callback) {
      deleteOrder = []
      eventStack.forEach(function(evt, idx) {
        if (evt.event === event) {
          element.removeEventListener(evt.event, evt.callback, evt.capturePhase)
          deleteOrder.push(idx)
        }
      })

      deleteFromEventStack(deleteOrder, eventStack)

    } else if (callback) {
      deleteOrder = []
      eventStack.forEach(function(evt, idx) {
        if (callback === evt.callback) {
          element.removeEventListener(evt.event, evt.callback, evt.capturePhase)
          deleteOrder.push(idx)
        }
      })
      deleteFromEventStack(deleteOrder, eventStack)
    }
  }
function(element, event, callback) {

    const eventStack = ChuiEventCache.elements[element.id]
    if (!eventStack) return
    let deleteOrder = []

    if (!event) {
      deleteOrder = []
      eventStack.forEach(function(evt, idx) {
        element.removeEventListener(evt.event, evt.callback, evt.capturePhase)
        deleteOrder.push(idx)
      })

      deleteFromEventStack(deleteOrder, eventStack)

    } else if (!!event && !callback) {
      deleteOrder = []
      eventStack.forEach(function(evt, idx) {
        if (evt.event === event) {
          element.removeEventListener(evt.event, evt.callback, evt.capturePhase)
          deleteOrder.push(idx)
        }
      })

      deleteFromEventStack(deleteOrder, eventStack)

    } else if (callback) {
      deleteOrder = []
      eventStack.forEach(function(evt, idx) {
        if (callback === evt.callback) {
          element.removeEventListener(evt.event, evt.callback, evt.capturePhase)
          deleteOrder.push(idx)
        }
      })
      deleteFromEventStack(deleteOrder, eventStack)
    }
  }
function ( element , event , callback ) { const eventStack = ChuiEventCache . elements [ element . id ] if ( ! eventStack ) return let deleteOrder = [ ] if ( ! event ) { deleteOrder = [ ] eventStack . forEach ( function ( evt , idx ) { element . removeEventListener ( evt . event , evt . callback , evt . capturePhase ) deleteOrder . push ( idx ) } ) deleteFromEventStack ( deleteOrder , eventStack ) } else if ( ! ! event && ! callback ) { deleteOrder = [ ] eventStack . forEach ( function ( evt , idx ) { if ( evt . event === event ) { element . removeEventListener ( evt . event , evt . callback , evt . capturePhase ) deleteOrder . push ( idx ) } } ) deleteFromEventStack ( deleteOrder , eventStack ) } else if ( callback ) { deleteOrder = [ ] eventStack . forEach ( function ( evt , idx ) { if ( callback === evt . callback ) { element . removeEventListener ( evt . event , evt . callback , evt . capturePhase ) deleteOrder . push ( idx ) } } ) deleteFromEventStack ( deleteOrder , eventStack ) } }
Private method to unbind events on ChuiEventCache
Private method to unbind events on ChuiEventCache