Associate each segment (an object) with an element (a jQuery object), by setting each `segment.element`. Run each element through the `eventRender` filter, which allows developers to modify an existing element, supply a new one, or cancel rendering.
509771
function resolveElements(segments, elements) {
		for (var i=0; i<segments.length; i++) {
			var segment = segments[i];
			var event = segment.event;
			var element = elements.eq(i);

			// call the trigger with the original element
			var triggerRes = trigger('eventRender', event, event, element);

			if (triggerRes === false) {
				// if `false`, remove the event from the DOM and don't assign it to `segment.event`
				element.remove();
			}
			else {
				if (triggerRes && triggerRes !== true) {
					// the trigger returned a new element, but not `true` (which means keep the existing element)

					// re-assign the important CSS dimension properties that were already assigned in `buildHTMLForSegment`
					triggerRes = $(triggerRes)
						.css({
							position: 'absolute',
							left: segment.left
						});

					element.replaceWith(triggerRes);
					element = triggerRes;
				}

				segment.element = element;
			}
		}
	}
1153964
function buildSegments(events) {
		var segments = [];
		for (var i=0; i<events.length; i++) {
			var eventSegments = buildSegmentsForEvent(events[i]);
			segments.push.apply(segments, eventSegments); // append an array to an array
		}
		return segments;
	}
827177
function(e) {
      switch (e.data.action) {
        case 'start':
          init(
            new Float32Array(e.data.nodes),
            new Float32Array(e.data.edges),
            e.data.config
          );

          // First iteration(s)
          run(W.settings.startingIterations);
          break;

        case 'loop':
          NodeMatrix = new Float32Array(e.data.nodes);
          run(W.settings.iterationsPerRender);
          break;

        case 'config':

          // Merging new settings
          configure(e.data.config);
          break;

        case 'kill':

          // Deleting context for garbage collection
          __emptyObject(W);
          NodeMatrix = null;
          EdgeMatrix = null;
          RegionMatrix = null;
          self.removeEventListener('message', listener);
          break;

        default:
      }
    }
848623
function(item) {
        item = $(item);

        // Using event `remove` will cause the DOM element to delete itself
        this.fireEvent('removing', [item]);

        this.items.filter(item).remove();

        this.refresh();
    }
222286
function(element) {
      var node = element[0] || element;

      document.addEventListener('click', function focusOnClick(ev) {
        if (ev.target === node && ev.$focus) {
          node.focus();
          ev.stopImmediatePropagation();
          ev.preventDefault();
          node.removeEventListener('click', focusOnClick);
        }
      }, true);

      var newEvent = document.createEvent('MouseEvents');
      newEvent.initMouseEvent('click', false, true, window, {}, 0, 0, 0, 0,
        false, false, false, false, 0, null);
      newEvent.$material = true;
      newEvent.$focus = true;
      node.dispatchEvent(newEvent);
    }
1207844
def _add_event_in_element(self, element, event):
        

        if not self.main_script_added:
            self._generate_main_scripts()

        if self.script_list is not None:
            self.id_generator.generate_id(element)
            self.script_list.append_text(
                event
                + "Elements.push('"
                + element.get_attribute('id')
                + "');"
            )
514141
function ElementTree(id, instantiationOptions) {
			var areInstantiationOptionsAnObject = _isObject(instantiationOptions);
			var options;

			/**
			 * Make sure that the options parameter is Object and
			 * that the ElementTree can be instantiate without initial options.
			 */
			if (areInstantiationOptionsAnObject) {
				options = instantiationOptions;
			} else {
				options = {};
			}

			// Save DOM reference
			this._ElementTreeContainer = document.getElementById(id);

			/**
			 * Method fired when the number of issues against an element is clicked
			 */
			this.onIssueCountClicked = options.onIssueCountClicked ? options.onIssueCountClicked : function () {};

			/**
			 * Method fired when the selected element in the ElementTree is changed.
			 * @param {string} selectedElementId - The selected element id
			 */
			this.onSelectionChanged = options.onSelectionChanged ? options.onSelectionChanged : function (selectedElementId) {};

			/**
			 * Method fired when the hovered element in the ElementTree is changed.
			 * @param {string} hoveredElementId - The hovered element id
			 */
			this.onHoverChanged = options.onHoverChanged ? options.onHoverChanged : function (hoveredElementId) {};

			/**
			 * Method fired when the mouse is out of the ElementTree.
			 */
			this.onMouseOut = options.onMouseOut ? options.onMouseOut : function () {};

			/**
			 * Method fired when the initial ElementTree rendering is done.
			 */
			this.onInitialRendering = options.onInitialRendering ? options.onInitialRendering : function () {};

			// Object with the tree model that will be visualized
			this.setData(options.data);
		}
1143651
function( elems, name, selector ) {
		// Build a new jQuery matched element set
		var ret = this.constructor();

		if ( jQuery.isArray( elems ) ) {
			push.apply( ret, elems );

		} else {
			jQuery.merge( ret, elems );
		}

		// Add the old object onto the stack (as a reference)
		ret.prevObject = this;

		ret.context = this.context;

		if ( name === "find" ) {
			ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
		} else if ( name ) {
			ret.selector = this.selector + "." + name + "(" + selector + ")";
		}

		// Return the newly-formed element set
		return ret;
	}
87668
function (element) {
            $(element).find(':input').each(function (index, inputObj) {
                putFieldValue(inputObj, getFieldValue(inputObj), true);
            });
        }
1032884
private void render(SVG.Group obj)
   {
      debug("Group render");

      updateStyleForElement(state, obj);

      if (!display())
         return;

      if (obj.transform != null) {
         canvas.concat(obj.transform);
      }

      checkForClipPath(obj);

      boolean  compositing = pushLayer();

      renderChildren(obj, true);

      if (compositing)
         popLayer(obj);

      updateParentBoundingBox(obj);
   }
1304278
function(items) {
            items = $.makeArray(items);

            for (var i = 0; i < items.length; i++) {
                var item = items[i];

                // Make sure this element doesn't belong to another dragger
                if ($.data(item, 'drag')) {
                    Garnish.log('Element was added to more than one dragger');
                    $.data(item, 'drag').removeItems(item);
                }

                // Add the item
                $.data(item, 'drag', this);

                // Add the listener
                this.addListener(item, 'mousedown', '_handleMouseDown');
            }

            this.$items = this.$items.add(items);
        }
1075744
private void processElement(Element element) {
    context.setCurrentSegment(element);
    currentProp = null;
    currentAttribute = null;

    // Process attributes
    boolean shouldPopContext = processElementAttributes(element);

    // Process text segments
    StreamSupport
        .stream(((Iterable<Segment>) element::getNodeIterator).spliterator(), false)
        .filter(segment -> !(segment instanceof Tag)
            && !(segment instanceof CharacterReference))
        .filter(segment -> {
          for (Element child : element.getChildElements()) {
            if (child.encloses(segment)) {
              return false;
            }
          }
          return true;
        })
        .forEach(this::processTextNode);

    // Recurse downwards
    element.getChildElements().
        forEach(this::processElement);

    // After downward recursion, pop the context layer if necessary
    if (shouldPopContext) {
      context.popContextLayer();
    }
  }
852571
function (e) {
							var t = _t(e);
							if ((children == null && (t == obj && !obj.__tamee.over)) || (matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over))) {
								meeHelper("mouseenter", e, obj, t);
								t.__tamee = t.__tamee || {};
								t.__tamee.over = true;
								activeElements.push(t);
							}
						}
331246
function addEventListener(el, eventName, handler) {
    removeEventListener(el, eventName, handler);

    if (window.jQuery) {
      $(el).on(eventName, handler);
    } else if (el.addEventListener) {
      el.addEventListener(eventName, handler);
    } else {
      el.attachEvent('on' + eventName, function () {
        handler.call(el);
      });
    }
  }
296341
function() {
            var n_components = 0;
            var componentRendered = _.bind(function() {
                n_components = n_components + 1;
                if (n_components >= this.countComponents) {
                    this.ready();
                }
            }, this);

            if (_.size(this.components) == 0) { this.ready(); return this; }

            var addComponent = _.bind(Q.fbind(function(component) {
                this.$("component[data-component='"+component.cid+"']").replaceWith(component.$el);
                component.defer(_.once(componentRendered));

                return Q.try(function() {
                    component.update();
                }).fail(function(err) {
                    logging.exception(err, "Error rendering component:");
                })
            }), this);

            _.each(this.components, function(value, cid) {
                if (_.isArray(value)) {
                    _.each(value, addComponent);
                } else {
                    addComponent(value);
                }
            });

            this.trigger("components:render");
            return this;
        }
1099845
function Events (el, obj) {
  if (!(this instanceof Events)) return new Events(el, obj)
  if (!el) throw new Error('element required')
  if (!obj) throw new Error('object required')
  this.el = el
  this.obj = obj
  this._events = {}
}
904898
function attributes(el, attrs, store) {
  for(var key in attrs) {
    var value = attrs[key];
    if(typeof value === 'object') value = styles(value);
    else if(typeof value === 'function') {
      var bool = key.substring(0, 2) === 'on';
      if(bool) el.addEventListener(key.slice(2), value);
      else el.setAttribute(key, value.call(store.data));
      // @not we should compute the function if it's not an event
      break;
    }

    bind(value, function(data) {
       // @note should refactor with render (too bad attribute can't append text node anymore)
       el.setAttribute(this, data);
    }.bind(key), store);
  }
}