How to use the fbjs/lib/EventListener.listen function in fbjs

To help you get started, we’ve selected a few fbjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aemoe / webpack-react-framework / node_modules / react / lib / SimpleEventPlugin.js View on Github external
didPutListener: function (inst, registrationName, listener) {
    // Mobile Safari does not fire properly bubble click events on
    // non-interactive elements, which means delegated click listeners do not
    // fire. The workaround for this bug involves attaching an empty click
    // listener on the target node.
    if (registrationName === ON_CLICK_KEY) {
      var id = inst._rootNodeID;
      var node = ReactDOMComponentTree.getNodeFromInstance(inst);
      if (!onClickListeners[id]) {
        onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
      }
    }
  },
github stolksdorf / vitreum / node_modules / react / lib / SimpleEventPlugin.js View on Github external
didPutListener: function (id, registrationName, listener) {
    // Mobile Safari does not fire properly bubble click events on
    // non-interactive elements, which means delegated click listeners do not
    // fire. The workaround for this bug involves attaching an empty click
    // listener on the target node.
    if (registrationName === ON_CLICK_KEY) {
      var node = ReactMount.getNode(id);
      if (!onClickListeners[id]) {
        onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
      }
    }
  },
github DeligenceTechnologies / PanoplyCMS / node_modules / react / lib / SimpleEventPlugin.js View on Github external
didPutListener: function (inst, registrationName, listener) {
    // Mobile Safari does not fire properly bubble click events on
    // non-interactive elements, which means delegated click listeners do not
    // fire. The workaround for this bug involves attaching an empty click
    // listener on the target node.
    if (registrationName === ON_CLICK_KEY) {
      var key = getDictionaryKey(inst);
      var node = ReactDOMComponentTree.getNodeFromInstance(inst);
      if (!onClickListeners[key]) {
        onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
      }
    }
  },
github mendersoftware / gui / node_modules / react / lib / SimpleEventPlugin.js View on Github external
didPutListener: function (inst, registrationName, listener) {
    // Mobile Safari does not fire properly bubble click events on
    // non-interactive elements, which means delegated click listeners do not
    // fire. The workaround for this bug involves attaching an empty click
    // listener on the target node.
    if (registrationName === ON_CLICK_KEY) {
      var key = getDictionaryKey(inst);
      var node = ReactDOMComponentTree.getNodeFromInstance(inst);
      if (!onClickListeners[key]) {
        onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
      }
    }
  },
github larrymyers / react-mini-router / lib / RouterMixin.js View on Github external
componentDidMount: function() {
        var _events = this._events = [];

        _events.push(EventListener.listen(ReactDOM.findDOMNode(this), 'click', this.handleClick));

        if (this.state.useHistory) {
            _events.push(EventListener.listen(window, 'popstate', this.onPopState));
        } else {
            if (window.location.hash.indexOf('#!') === -1) {
                window.location.hash = '#!/';
            }

            _events.push(EventListener.listen(window, 'hashchange', this.onPopState));
        }
    },
github mendersoftware / gui / node_modules / react / lib / ReactEventListener.js View on Github external
monitorScrollValue: function (refresh) {
    var callback = scrollValueMonitor.bind(null, refresh);
    EventListener.listen(window, 'scroll', callback);
  },
github larrymyers / react-mini-router / lib / RouterMixin.js View on Github external
componentDidMount: function() {
        var _events = this._events = [];

        _events.push(EventListener.listen(ReactDOM.findDOMNode(this), 'click', this.handleClick));

        if (this.state.useHistory) {
            _events.push(EventListener.listen(window, 'popstate', this.onPopState));
        } else {
            if (window.location.hash.indexOf('#!') === -1) {
                window.location.hash = '#!/';
            }

            _events.push(EventListener.listen(window, 'hashchange', this.onPopState));
        }
    },
github aemoe / webpack-react-framework / node_modules / react / lib / ReactEventListener.js View on Github external
monitorScrollValue: function (refresh) {
    var callback = scrollValueMonitor.bind(null, refresh);
    EventListener.listen(window, 'scroll', callback);
  },
github ServiceStackApps / typescript-redux / src / TypeScriptRedux / jspm_packages / npm / react@0.14.7 / lib / ReactEventListener.js View on Github external
trapBubbledEvent: function(topLevelType, handlerBaseName, handle) {
      var element = handle;
      if (!element) {
        return null;
      }
      return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
    },
    trapCapturedEvent: function(topLevelType, handlerBaseName, handle) {
github subschema / subschema / src / Dom.js View on Github external
function listen(node, event, func) {
    return EventListener.listen(ownerDocument(node), event, func);
}
/**