------------------------------------------------------ event handler
12781
private void toggle() {
        if (toggle.checked) {
            element().classList.add("completed");
        } else {
            element().classList.remove("completed");
        }
        repository().complete(item(), toggle.checked);
        application().update();
    }
735879
function EventListener(el, context) {
    this.context = context || null;

    this.el = el;

    this.events = {};

    this._onEvent = this._onEvent.bind(this);
}
657543
function globalEventHandler(event) {
    if (listeners[event.type]) {
      listeners[event.type].forEach(function(currentHandler) {
        currentHandler.call(this, event);
      }, this);
    }
  }
584085
def on_click(self, handler):
        ''' 

        '''
        self.on_event(ButtonClick, handler)
        self.on_event(MenuItemClick, handler)
1019901
@UiHandler("m_okButton")
    protected void onOk(ClickEvent event) {

        if (!((m_croppingParam.getTargetWidth() > 0) && (m_croppingParam.getTargetHeight() > 0))) {
            if (m_croppingParam.getTargetWidth() > 0) {
                m_croppingParam.setTargetHeight(
                    (int)Math.floor(
                        (1.00 * m_croppingParam.getTargetWidth() * m_croppingParam.getCropHeight())
                            / m_croppingParam.getCropWidth()));
            } else if (m_croppingParam.getTargetHeight() > 0) {
                m_croppingParam.setTargetWidth(
                    (int)Math.floor(
                        (1.00 * m_croppingParam.getTargetHeight() * m_croppingParam.getCropWidth())
                            / m_croppingParam.getCropHeight()));
            } else {
                m_croppingParam.setTargetHeight(m_croppingParam.getCropHeight());
                m_croppingParam.setTargetWidth(m_croppingParam.getCropWidth());
            }
        }
        ValueChangeEvent.fire(this, m_croppingParam);
        hide();
    }
831033
function(element, type, handler) {
    var types = type.split(' ');
    Utils.each(types, function(type){
      element.addEventListener(type, handler, false);
    });
  }
238895
function listenersHelp (element, events, handler, method) {
  let list = events.split(' ')
  for (let i = 0, len = list.length; i < len; i++) {
    let item = list[i]
    if (method === false) {
      element.removeEventListener(item, handler)
    } else {
      element.addEventListener(item, handler, false)
    }
  }
}
1073165
function handleClick(event) {
  const rootNode = document;
  let element = event.target;

  while (element && element !== rootNode) {
    const category = element.getAttribute('data-ga-event-category');

    // We reach a tracking element, no need to look higher in the dom tree.
    if (category) {
      window.ga('send', {
        hitType: 'event',
        eventCategory: category,
        eventAction: element.getAttribute('data-ga-event-action'),
        eventLabel: element.getAttribute('data-ga-event-label'),
      });
      break;
    }

    element = element.parentNode;
  }
}
158687
function checkboxHandler (event) {
    const target = event.target;

    if (target.checked) {
      link.style.display = 'none';
      if (upload.value) {
        upload.value = '';
        link = clear(link);
      }
    }
    else {
      link.style.display = '';
    }
  }
42854
function once(eventName, handler, context, args) {
    this.on(eventName, handler, context, args, true);
}
1008884
function on(el, eventName, callback) {
  if (el.addEventListener) {
    el.addEventListener(eventName, callback, false);
  }
  else if (el.attachEvent) {
    el.attachEvent('on'+eventName, function(e) {
      callback.call(el, e || window.event);
    });
  }
}
779039
function(event, handler) {
    return events.on({
      listeners: this._listeners,
      event: event,
      handler: handler
    });
  }
974466
@Override
    public void onBrowserEvent(Event event) {

        super.onBrowserEvent(event);

        switch (DOM.eventGetType(event)) {
            case Event.ONMOUSEUP:
                Event.releaseCapture(m_slider.getElement());
                m_capturedMouse = false;
                break;
            case Event.ONMOUSEDOWN:
                Event.setCapture(m_slider.getElement());
                m_capturedMouse = true;
                //$FALL-THROUGH$
            case Event.ONMOUSEMOVE:
                if (m_capturedMouse) {
                    event.preventDefault();
                    float x = ((event.getClientX() - (m_colorUnderlay.getAbsoluteLeft())) + Window.getScrollLeft());
                    float y = ((event.getClientY() - (m_colorUnderlay.getAbsoluteTop())) + Window.getScrollTop());

                    if (m_parent != null) {
                        m_parent.onMapSelected(x, y);
                    }

                    setSliderPosition(x, y);
                }
                //$FALL-THROUGH$
            default:

        }
    }
1210271
function handler(e) {
			// allow tab navigation (conditionally)
			if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
				if (pageBlock && e.data.constrainTabKey) {
					var els = pageBlockEls;
					var fwd = !e.shiftKey && e.target === els[els.length-1];
					var back = e.shiftKey && e.target === els[0];
					if (fwd || back) {
						setTimeout(function(){focus(back);},10);
						return false;
					}
				}
			}
			var opts = e.data;
			var target = $(e.target);
			if (target.hasClass('blockOverlay') && opts.onOverlayClick)
				opts.onOverlayClick(e);

			// allow events within the message content
			if (target.parents('div.' + opts.blockMsgClass).length > 0)
				return true;

			// allow events for content that is not being blocked
			return target.parents().children().filter('div.blockUI').length === 0;
		}
695574
function() {

    this.on = this.addEventListener = function(type, listener) {
        if (!this.events[type]) {
            this.events[type] = [];
        }

        this.events[type].push(listener);
    };

    this.off = this.removeEventListener = function (type, listener) {
        if (!!this.events[type]) {
            for(var i = 0; i < this.events[type].length; i++) {
                if (this.events[type][i] === listener) {
                    this.events[type][i] = null;
                    this.events[type].splice(i, 1);
                    return;
                }
            }
        }
    };

    this.removeAllListeners = function (type) {
        this.events[type] = [];
    };

    var emit = function(cb, event) {
        // Handle callbacks asynchronously
        setTimeout(function() {
            cb(event);
        }, 0);

    };

    this.dispatchEvent = function (event) {
        if (!!event.type) {
            var type = event.type;
            if (!!this.events[type]) {
                event.target = this;
                for (var i = 0; i < this.events[type].length && (event.returnValue === undefined || event.returnValue) ; i++) {
                    var cb = this.events[type][i];
                    // Dereference cb for async
                    emit(cb.bind(event.target), event);
                }
            }
        }
    };
}
347365
function mouseEnterHandler(e) {
        e = e || window.event;

        if (checkMouse(element, e)) {
            eventHandler(e);
        }
    }
932259
function init ($container, elementSelector, eventSelectors, handler) {
      $container = $container || $(document.body)

      // Handle control clicks
      function deferred () {
        var $control = $(this)
        handler($control, getToggledContent($control))
      }

      // Prepare ARIA attributes
      var $controls = $(elementSelector)
      $controls.each(initToggledContent)

      // Handle events
      $.each(eventSelectors, function (idx, eventSelector) {
        $container.on('click.' + selectors.namespace, eventSelector, deferred)
      })

      // Any already :checked on init?
      if ($controls.is(':checked')) {
        $controls.filter(':checked').each(deferred)
      }
    }