code
stringlengths
28
313k
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
74
language
stringclasses
1 value
repo
stringlengths
5
60
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function getSiblingNode(node) { while (node) { if (node.nextSibling) { return node.nextSibling; } node = node.parentNode; } }
Get the next sibling within a container. This will walk up the DOM if a node's siblings have been exhausted. @param {DOMElement|DOMTextNode} node @return {?DOMElement|DOMTextNode}
getSiblingNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getNodeForCharacterOffset(root, offset) { var node = getLeafNode(root); var nodeStart = 0; var nodeEnd = 0; while (node) { if (node.nodeType === 3) { nodeEnd = nodeStart + node.textContent.length; if (nodeStart <= offset && nodeEnd >= offset) { return { node...
Get object describing the nodes which contain characters at offset. @param {DOMElement|DOMTextNode} root @param {number} offset @return {?object}
getNodeForCharacterOffset
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function containsNode(outerNode, innerNode) { if (!outerNode || !innerNode) { return false; } else if (outerNode === innerNode) { return true; } else if (isTextNode(outerNode)) { return false; } else if (isTextNode(innerNode)) { return containsNode(outerNode, innerNode.parentNode); } ...
Checks if a given DOM node contains or is another DOM node.
containsNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isTextNode(object) { return isNode(object) && object.nodeType == 3; }
@param {*} object The object to check. @return {boolean} Whether or not the object is a DOM text node.
isTextNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isNode(object) { return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); }
@param {*} object The object to check. @return {boolean} Whether or not the object is a DOM node.
isNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getActiveElement() /*?DOMElement*/{ if (typeof document === 'undefined') { return null; } try { return document.activeElement || document.body; } catch (e) { return document.body; } }
Same as document.activeElement but wraps in a try-catch block. In IE it is not safe to call document.activeElement if there is nothing focused. The activeElement will be null only if the document or document body is not yet defined.
getActiveElement
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getSelection(node) { if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) { return { start: node.selectionStart, end: node.selectionEnd }; } else if (window.getSelection) { var selection = window.getSelection(); return { anchorNode: ...
Get an object which is a unique representation of the current selection. The return value will not be consistent across nodes or browsers, but two identical selections on the same node will return identical objects. @param {DOMElement} node @return {object}
getSelection
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function constructSelectEvent(nativeEvent, nativeEventTarget) { // Ensure we have the right element, and that the user is not dragging a // selection (this matches native `select` event behavior). In HTML5, select // fires only on input and textarea thus if there's no focused element we // won't dispatch. ...
Poll selection to see whether it's changed. @param {object} nativeEvent @return {?SyntheticEvent}
constructSelectEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getDictionaryKey(inst) { // Prevents V8 performance issue: // https://github.com/facebook/react/pull/7232 return '.' + inst._rootNodeID; }
Turns ['abort', ...] into eventTypes = { 'abort': { phasedRegistrationNames: { bubbled: 'onAbort', captured: 'onAbortCapture', }, dependencies: ['topAbort'], }, ... }; topLevelEventsToDispatchConfig = { 'topAbort': { sameConfig } };
getDictionaryKey
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getEventCharCode(nativeEvent) { var charCode; var keyCode = nativeEvent.keyCode; if ('charCode' in nativeEvent) { charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`. if (charCode === 0 && keyCode === 13) { charCode = 13; ...
`charCode` represents the actual "character code" and is safe to use with `String.fromCharCode`. As such, only keys that correspond to printable characters produce a valid `charCode`, the only exception to this is Enter. The Tab-key is considered non-printable and does not have a `charCode`, presumably because it does ...
getEventCharCode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getEventKey(nativeEvent) { if (nativeEvent.key) { // Normalize inconsistent values reported by browsers due to // implementations of a working draft specification. // FireFox implements `key` but returns `MozPrintableKey` for all // printable characters (normalized to `Unidentified`), i...
@param {object} nativeEvent Native browser event. @return {string} Normalized `key` property.
getEventKey
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@param {object} dispatchConfig Configuration used to dispatch this event. @param {string} dispatchMarker Marker identifying the event target. @param {object} nativeEvent Native browser event. @extends {SyntheticMouseEvent}
SyntheticWheelEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function firstDifferenceIndex(string1, string2) { var minLen = Math.min(string1.length, string2.length); for (var i = 0; i < minLen; i++) { if (string1.charAt(i) !== string2.charAt(i)) { return i; } } return string1.length === string2.length ? -1 : minLen; }
Finds the index of the first character that's not common between the two given strings. @return {number} the index of the character where the strings diverge
firstDifferenceIndex
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getReactRootElementInContainer(container) { if (!container) { return null; } if (container.nodeType === DOC_NODE_TYPE) { return container.documentElement; } else { return container.firstChild; } }
@param {DOMElement|DOMDocument} container DOM element that may contain a React component @return {?*} DOM element that may have the reactRoot ID, or null.
getReactRootElementInContainer
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) { var markerName; if (ReactFeatureFlags.logTopLevelRenders) { var wrappedElement = wrapperInstance._currentElement.props.child; var type = wrappedElement.type; markerName = 'React mount: ' + (typeof...
Mounts this component and inserts it into the DOM. @param {ReactComponent} componentInstance The instance to mount. @param {DOMElement} container DOM element to mount into. @param {ReactReconcileTransaction} transaction @param {boolean} shouldReuseMarkup If true, do not insert markup
mountComponentIntoNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) { var transaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* useCreateElement */ !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement); transaction.perform(mountComponentIntoNode, null, compon...
Batched mount. @param {ReactComponent} componentInstance The instance to mount. @param {DOMElement} container DOM element to mount into. @param {boolean} shouldReuseMarkup If true, do not insert markup
batchedMountComponentIntoNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function unmountComponentFromNode(instance, container, safely) { if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onBeginFlush(); } ReactReconciler.unmountComponent(instance, safely); if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onEndFlush(...
Unmounts a component and removes it from the DOM. @param {ReactComponent} instance React component instance. @param {DOMElement} container DOM element to unmount from. @final @internal @see {ReactMount.unmountComponentAtNode}
unmountComponentFromNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function hasNonRootReactChild(container) { var rootEl = getReactRootElementInContainer(container); if (rootEl) { var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl); return !!(inst && inst._hostParent); } }
True if the supplied DOM node has a direct React-rendered child that is not a React root element. Useful for warning in `render`, `unmountComponentAtNode`, etc. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM element contains a direct child that was rendered by React but is not a ro...
hasNonRootReactChild
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function nodeIsRenderedByOtherInstance(container) { var rootEl = getReactRootElementInContainer(container); return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl)); }
True if the supplied DOM node is a React DOM element and it has been rendered by another copy of React. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM has been rendered by another copy of React @internal
nodeIsRenderedByOtherInstance
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isValidContainer(node) { return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)); }
True if the supplied DOM node is a valid node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid DOM node. @internal
isValidContainer
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isReactNode(node) { return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME)); }
True if the supplied DOM node is a valid React node element. @param {?DOMElement} node The candidate DOM node. @return {boolean} True if the DOM is a valid React DOM node. @internal
isReactNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
TopLevelWrapper = function () { this.rootID = topLevelRootCounter++; }
Temporary (?) hack so that we can store all top-level pending updates on composites instead of having to worry about different types of components here.
TopLevelWrapper
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function findDOMNode(componentOrElement) { if (process.env.NODE_ENV !== 'production') { var owner = ReactCurrentOwner.current; if (owner !== null) { process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should ...
Returns the DOM node rendered by this element. See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode @param {ReactComponent|DOMElement} componentOrElement @return {?DOMElement} The root node of this element.
findDOMNode
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function assert( fn ) { var el = document.createElement("fieldset"); try { return !!fn( el ); } catch (e) { return false; } finally { // Remove from its parent by default if ( el.parentNode ) { el.parentNode.removeChild( el ); } // release memory in IE el = null; } }
Support testing using an element @param {Function} fn Passed the created element and returns a boolean result
assert
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function createDisabledPseudo( disabled ) { // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable return function( elem ) { // Only certain elements can match :enabled or :disabled // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled // https:/...
Returns a function to use in pseudos for :enabled/:disabled @param {Boolean} disabled true for :disabled; false for :enabled
createDisabledPseudo
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function arr_diff(a, b) { var seen = [], diff = [], i; for (i = 0; i < b.length; i++) seen[b[i]] = true; for (i = 0; i < a.length; i++) if (!seen[a[i]]) diff.push(a[i]); return diff; }
Truncate a string to fit within an SVG text node CSS text-overlow doesn't apply to SVG <= 1.2 @author Dan de Havilland (github.com/dandehavilland) @date 2014-12-02
arr_diff
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function warn_deprecation(message, untilVersion) { console.warn('Deprecation: ' + message + (untilVersion ? '. This feature will be removed in ' + untilVersion + '.' : ' the near future.')); console.trace(); }
Wrap the contents of a text node to a specific width Adapted from bl.ocks.org/mbostock/7555321 @author Mike Bostock @author Dan de Havilland @date 2015-01-14
warn_deprecation
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function chart(selection) { renderWatch.reset(); renderWatch.models(scatter); selection.each(function(data) { var availableWidth = width - margin.left - margin.right, availableHeight = height - margin.top - margin.bottom; container = d3.select(this)...
********************************* offset: 'wiggle' (stream) 'zero' (stacked) 'expand' (normalize to 100%) 'silhouette' (simple centered) order: 'inside-out' (stream) 'default' (input order) **********************************
chart
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function checkMask(value, bitmask) { return (value & bitmask) === bitmask; }
Mapping from normalized, camelcased property names to a configuration that specifies how the associated DOM property should be accessed or rendered.
checkMask
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function inject() { if (alreadyInjected) { // TODO: This is currently true because these injections are shared between // the client and the server package. They should be built independently // and not share any injection state. Then this problem will be solved. return; } alreadyInjected =...
Some important event plugins included by default (without having to require them).
inject
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function accumulateTwoPhaseDispatches(events) { forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); }
A small set of propagation patterns, each of which will accept a small amount of information, and generate a set of "dispatch ready event objects" - which are sets of events that have already been annotated with a set of dispatched listener functions/ids. The API is designed this way to discourage these propagation str...
accumulateTwoPhaseDispatches
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function warn(action, result) { var warningCondition = false; process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original ...
@interface Event @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 /#events-inputevents
warn
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getTargetInstForChangeEvent(topLevelType, targetInst) { if (topLevelType === 'topChange') { return targetInst; } }
(For IE <=11) Replacement getter/setter for the `value` property that gets set on the active element.
getTargetInstForChangeEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || ele...
This plugin creates an `onChange` event that normalizes change events across form elements. This event fires at a time when it's possible to change the element's value without seeing a flicker. Supported elements are: - input (see `isTextInputElement`) - textarea - select
shouldUseClickEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@interface UIEvent @see http://www.w3.org/TR/DOM-Level-3-Events/
SyntheticMouseEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
checkRenderMessage = function (owner) { if (owner) { var name = owner.getName(); if (name) { return ' Check the render method of `' + name + '`.'; } } return ''; }
Operations for dealing with CSS properties.
checkRenderMessage
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isAttributeNameSafe(attributeName) { if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { return true; } if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { return false; } if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validatedAttributeNameCache[att...
Creates markup for the ID property. @param {string} id Unescaped ID. @return {string} Markup string.
isAttributeNameSafe
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function shouldIgnoreValue(propertyInfo, value) { return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; }
Creates markup for a property. @param {string} name @param {*} value @return {?string} Markup string, or null if the property was invalid.
shouldIgnoreValue
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getDeclarationErrorAddendum(owner) { if (owner) { var name = owner.getName(); if (name) { return ' Check the render method of `' + name + '`.'; } } return ''; }
@param {object} inputProps Props for form component @return {*} current value of the input either from value prop or link.
getDeclarationErrorAddendum
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function flattenChildren(children) { var content = ''; // Flatten children and warn if they aren't strings or numbers; // invalid types are ignored. React.Children.forEach(children, function (child) { if (child == null) { return; } if (typeof child === 'string' || typeof child === 'nu...
Implements an <option> host component that warns when `selected` is set.
flattenChildren
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function processQueue(inst, updateQueue) { ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue); }
ReactMultiChild are capable of reconciling multiple children. @class ReactMultiChild @internal
processQueue
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
getDebugID = function (inst) { if (!inst._debugID) { // Check for ART-like instances. TODO: This is silly/gross. var internal; if (internal = ReactInstanceMap.get(inst)) { inst = internal; } } return inst._debugID; }
Provides common functionality for components that must reconcile multiple children. This is used by `ReactDOMComponent` to mount, update, and unmount child components. @lends {ReactMultiChild.prototype}
getDebugID
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function instantiateChild(childInstances, child, name, selfDebugID) { // We found a component instance. var keyUnique = childInstances[name] === undefined; if (process.env.NODE_ENV !== 'production') { if (!ReactComponentTreeHook) { ReactComponentTreeHook = __webpack_require__(28); } if (!...
ReactChildReconciler provides helpers for initializing or updating a set of children. Its output is suitable for passing it onto ReactMultiChild which does diffed reordering and insertion.
instantiateChild
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function warnNoop(publicInstance, callerName) { if (process.env.NODE_ENV !== 'production') { var constructor = publicInstance.constructor; process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMoun...
Checks whether or not this composite component is mounted. @param {ReactClass} publicInstance The instance we want to test. @return {boolean} True if mounted, false otherwise. @protected @final
warnNoop
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function scrollValueMonitor(cb) { var scrollPosition = getUnboundedScrollPosition(window); cb(scrollPosition); }
Traps top-level events by using event bubbling. @param {string} topLevelType Record from `EventConstants`. @param {string} handlerBaseName Event name (e.g. "click"). @param {object} element Element on which to attach listener. @return {?object} An object with a remove function which will forcefully re...
scrollValueMonitor
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isInDocument(node) { return containsNode(document.documentElement, node); }
@restoreSelection: If any selection information was potentially lost, restore it. This is useful when performing operations that could remove dom nodes and place them back in, resulting in focus being lost.
isInDocument
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@interface Event @see http://www.w3.org/TR/clipboard-apis/
SyntheticAnimationEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@interface KeyboardEvent @see http://www.w3.org/TR/DOM-Level-3-Events/
SyntheticFocusEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@interface TouchEvent @see http://www.w3.org/TR/touch-events/
SyntheticDragEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); }
@interface WheelEvent @see http://www.w3.org/TR/DOM-Level-3-Events/
SyntheticTransitionEvent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getBsProps(props) { return { bsClass: props.bsClass, bsSize: props.bsSize, bsStyle: props.bsStyle, bsRole: props.bsRole }; }
Add a style variant to a Component. Mutates the propTypes of the component in order to validate the new variant.
getBsProps
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function map(children, func, context) { var index = 0; return _react2['default'].Children.map(children, function (child) { if (!_react2['default'].isValidElement(child)) { return child; } return func.call(context, child, index++); }); }
Count the number of "valid components" in the Children container. @param {?*} children Children tree container. @returns {number}
map
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function forEach(children, func, context) { var index = 0; _react2['default'].Children.forEach(children, function (child) { if (!_react2['default'].isValidElement(child)) { return; } func.call(context, child, index++); }); }
Finds children that are typically specified as `props.children`, but only iterates over children that are "valid components". The provided forEachFunc(child, index) will be called for each leaf child with the index reflecting the position relative to "valid components". @param {?*} children Children tree container. @...
forEach
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isTrivialHref(href) { return !href || href.trim() === '#'; }
There are situations due to browser quirks or Bootstrap CSS where an anchor tag is needed, when semantically a button tag is the better choice. SafeAnchor ensures that when an anchor is used like a button its accessible. It also emulates input `disabled` behavior for links, which is usually desirable for Buttons, NavIt...
isTrivialHref
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Button() { (0, _classCallCheck3['default'])(this, Button); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Defines HTML button type attribute @defaultValue 'button'
Button
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function ButtonGroup() { (0, _classCallCheck3['default'])(this, ButtonGroup); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Display block buttons; only useful when used with the "vertical" prop. @type {bool}
ButtonGroup
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Carousel(props, context) { (0, _classCallCheck3['default'])(this, Carousel); var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props, context)); _this.handleMouseOver = _this.handleMouseOver.bind(_this); _this.handleMouseOut = _this.handleMouseOut.b...
Label shown to screen readers only, can be used to show the next element in the carousel. Set to null to deactivate.
Carousel
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function detectEvents() { var testEl = document.createElement('div'); var style = testEl.style; // On some platforms, in particular some releases of Android 4.x, // the un-prefixed "animation" and "transition" properties are defined on the // style object but the events that fire will still be prefixed,...
EVENT_NAME_MAP is used to determine which event fired when a transition/animation ends, based on the style property used to define that event.
detectEvents
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Checkbox() { (0, _classCallCheck3['default'])(this, Checkbox); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Attaches a ref to the `<input>` element. Only functions can be used here. ```js <Checkbox inputRef={ref => { this.input = ref; }} /> ```
Checkbox
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Clearfix() { (0, _classCallCheck3['default'])(this, Clearfix); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Apply clearfix on Large devices Desktops adds class `visible-lg-block`
Clearfix
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function ControlLabel() { (0, _classCallCheck3['default'])(this, ControlLabel); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Uses `controlId` from `<FormGroup>` if not explicitly specified.
ControlLabel
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Col() { (0, _classCallCheck3['default'])(this, Col); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Change the order of grid columns to the left for Large devices Desktops class-prefix `col-lg-pull-`
Col
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function triggerBrowserReflow(node) { node.offsetHeight; // eslint-disable-line no-unused-expressions }
Callback fired before the component expands
triggerBrowserReflow
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getDimensionValue(dimension, elem) { var value = elem['offset' + (0, _capitalize2['default'])(dimension)]; var margins = MARGINS[dimension]; return value + parseInt((0, _style2['default'])(elem, margins[0]), 10) + parseInt((0, _style2['default'])(elem, margins[1]), 10); }
Callback fired after the component starts to expand
getDimensionValue
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Transition(props, context) { _classCallCheck(this, Transition); var _this = _possibleConstructorReturn(this, (Transition.__proto__ || Object.getPrototypeOf(Transition)).call(this, props, context)); var initialStatus = void 0; if (props.in) { // Start enter transition in componentDi...
The Transition component lets you define and run css transitions with a simple declarative api. It works similar to React's own [CSSTransitionGroup](http://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup) but is specifically optimized for transitioning a single child "in" or "out". ...
Transition
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function ownerDocument(node) { return node && node.ownerDocument || document; }
Conenience method returns corresponding value for given keyName or keyCode. @param {Mixed} keyCode {Number} or keyName {String} @return {Mixed} @api public
ownerDocument
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function FormControl() { (0, _classCallCheck3['default'])(this, FormControl); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Attaches a ref to the `<input>` element. Only functions can be used here. ```js <FormControl inputRef={ref => { this.input = ref; }} /> ```
FormControl
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function FormGroup() { (0, _classCallCheck3['default'])(this, FormGroup); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Sets `id` on `<FormControl>` and `htmlFor` on `<FormGroup.Label>`.
FormGroup
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getDefaultComponent(children) { if (!children) { // FIXME: This is the old behavior. Is this right? return 'div'; } if (_ValidComponentChildren2['default'].some(children, function (child) { return child.type !== _ListGroupItem2['default'] || child.props.href || child.props.onClick; ...
You can use a custom element type for this component. If not specified, it will be treated as `'li'` if every child is a non-actionable `<ListGroupItem>`, and `'div'` otherwise.
getDefaultComponent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function MenuItem(props, context) { (0, _classCallCheck3['default'])(this, MenuItem); var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props, context)); _this.handleClick = _this.handleClick.bind(_this); return _this; }
Callback fired when the menu item is selected. ```js (eventKey: any, event: Object) => any ```
MenuItem
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
backdropRef = function backdropRef(ref) { return _this.backdrop = ref; }
A ModalManager instance used to track and manage the state of open Modals. Useful when customizing how modals interact within a container
backdropRef
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function findIndexOf(arr, cb) { var idx = -1; arr.some(function (d, i) { if (cb(d, i)) { idx = i; return true; } }); return idx; }
Proper state managment for containers and the modals in those containers. @internal Used by the Modal to ensure proper styling of containers.
findIndexOf
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
siblings = function siblings(container, mount, cb) { mount = [].concat(mount); [].forEach.call(container.children, function (node) { if (mount.indexOf(node) === -1 && isHidable(node)) { cb(node); } }); }
Firefox doesn't have a focusin event so using capture is easiest way to get bubbling IE8 can't do addEventListener, but does have onfocusin, so we use that in ie8 We only allow one Listener at a time to avoid stack overflows
siblings
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function ModalDialog() { (0, _classCallCheck3['default'])(this, ModalDialog); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
A css class to apply to the Modal dialog DOM node.
ModalDialog
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function ModalHeader() { (0, _classCallCheck3['default'])(this, ModalHeader); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
A Callback fired when the close button is clicked. If used directly inside a Modal component, the onHide will automatically be propagated up to the parent Modal `onHide`.
ModalHeader
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Nav() { (0, _classCallCheck3['default'])(this, Nav); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Float the Nav to the left. When `navbar` is `true` the appropriate contextual classes are added as well.
Nav
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Navbar(props, context) { (0, _classCallCheck3['default'])(this, Navbar); var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props, context)); _this.handleToggle = _this.handleToggle.bind(_this); _this.handleCollapse = _this.handleCollapse.bind(_this)...
Explicitly set the visiblity of the navbar body @controllable onToggle
Navbar
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function NavbarToggle() { (0, _classCallCheck3['default'])(this, NavbarToggle); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
The toggle content, if left empty it will render the default toggle (seen above).
NavbarToggle
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Overlay(props, context) { _classCallCheck(this, Overlay); var _this = _possibleConstructorReturn(this, (Overlay.__proto__ || Object.getPrototypeOf(Overlay)).call(this, props, context)); _this.state = { exited: !props.show }; _this.onHiddenListener = _this.handleHidden.bind(_this); re...
Built on top of `<Position/>` and `<Portal/>`, the overlay component is great for custom tooltip overlays.
Overlay
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Position(props, context) { _classCallCheck(this, Position); var _this = _possibleConstructorReturn(this, (Position.__proto__ || Object.getPrototypeOf(Position)).call(this, props, context)); _this.state = { positionLeft: 0, positionTop: 0, arrowOffsetLeft: null, arro...
The Position component calculates the coordinates for its child, to position it relative to a `target` component or node. Useful for creating callouts and tooltips, the Position component injects a `style` props with `left` and `top` values for positioning your component. It also injects "arrow" `left`, and `top` valu...
Position
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function isOneOf(one, of) { if (Array.isArray(of)) { return of.indexOf(one) >= 0; } return one === of; }
An element or text to overlay next to the target.
isOneOf
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Pagination() { (0, _classCallCheck3['default'])(this, Pagination); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
You can use a custom element for the buttons
Pagination
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Radio() { (0, _classCallCheck3['default'])(this, Radio); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
Attaches a ref to the `<input>` element. Only functions can be used here. ```js <Radio inputRef={ref => { this.input = ref; }} /> ```
Radio
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function TabContainer() { (0, _classCallCheck3['default'])(this, TabContainer); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
The `eventKey` of the currently active tab. @controllable onSelect
TabContainer
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function TabContent(props, context) { (0, _classCallCheck3['default'])(this, TabContent); var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props, context)); _this.handlePaneEnter = _this.handlePaneEnter.bind(_this); _this.handlePaneExited = _this.handlePane...
Unmount tabs (remove it from the DOM) when they are no longer visible
TabContent
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function TabPane(props, context) { (0, _classCallCheck3['default'])(this, TabPane); var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props, context)); _this.handleEnter = _this.handleEnter.bind(_this); _this.handleExited = _this.handleExited.bind(_this); ...
We override the `<TabContainer>` context so `<Nav>`s in `<TabPane>`s don't conflict with the top level one.
TabPane
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function getDefaultActiveKey(children) { var defaultActiveKey = void 0; _ValidComponentChildren2['default'].forEach(children, function (child) { if (defaultActiveKey == null) { defaultActiveKey = child.props.eventKey; } }); return defaultActiveKey; }
Unmount tabs (remove it from the DOM) when it is no longer visible
getDefaultActiveKey
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
function Tooltip() { (0, _classCallCheck3['default'])(this, Tooltip); return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments)); }
The "left" position value for the Tooltip arrow.
Tooltip
javascript
stitchfix/pyxley
tests/app/static/bundle.js
https://github.com/stitchfix/pyxley/blob/master/tests/app/static/bundle.js
MIT
constructor(t) { this.env = t }
RegExp: https:\/\/api\.m\.jd\.com\/client\.action\?functionId=(trade_config|genToken)
constructor
javascript
Toulu-debug/enen
iOS_Cookie.js
https://github.com/Toulu-debug/enen/blob/master/iOS_Cookie.js
MIT
function tower() { var args = Array.prototype.slice.call(arguments); var fn = args.pop(); args.push('--output-directory', 'tmp'); var child = spawn('./bin/tower', args); var result = ''; var error = ''; child.stdout.setEncoding('utf-8'); child.stdout.on('data', function(data){ result += data; }...
Execute a tower command, return output as string.
tower
javascript
tower-archive/tower
test/cli.js
https://github.com/tower-archive/tower/blob/master/test/cli.js
MIT
function encode(name, value) { return "&" + encodeURIComponent(name) + "=" + encodeURIComponent(value).replace(/%20/g, "+"); }
Modified Triggers browser event @param String eventName @param Object data - Add properties to event object
encode
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function Component(classDef, el, options) { _classCallCheck(this, Component); // Display error if el is valid HTML Element if (!(el instanceof Element)) { console.error(Error(el + ' is not an HTML Element')); } // If exists, destroy and reinitialize in child var ins = classDef.getInstanc...
Generic constructor for all components @constructor @param {Element} el @param {Object} options
Component
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function s4() { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); }
Generate approximated selector string for a jQuery object @param {jQuery} obj jQuery object to be parsed @returns {string}
s4
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function Collapsible(el, options) { _classCallCheck(this, Collapsible); var _this3 = _possibleConstructorReturn(this, (Collapsible.__proto__ || Object.getPrototypeOf(Collapsible)).call(this, Collapsible, el, options)); _this3.el.M_Collapsible = _this3; /** * Options for the collapsible...
Construct Collapsible instance @constructor @param {Element} el @param {Object} options
Collapsible
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function Modal(el, options) { _classCallCheck(this, Modal); var _this13 = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, Modal, el, options)); _this13.el.M_Modal = _this13; /** * Options for the modal * @member Modal#options ...
Construct Modal instance and set up overlay @constructor @param {Element} el @param {Object} options
Modal
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function Materialbox(el, options) { _classCallCheck(this, Materialbox); var _this16 = _possibleConstructorReturn(this, (Materialbox.__proto__ || Object.getPrototypeOf(Materialbox)).call(this, Materialbox, el, options)); _this16.el.M_Materialbox = _this16; /** * Options for the modal ...
Construct Materialbox instance @constructor @param {Element} el @param {Object} options
Materialbox
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function Tabs(el, options) { _classCallCheck(this, Tabs); var _this22 = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, Tabs, el, options)); _this22.el.M_Tabs = _this22; /** * Options for the Tabs * @member Tabs#options * @prop ...
Construct Tabs instance @constructor @param {Element} el @param {Object} options
Tabs
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function Tooltip(el, options) { _classCallCheck(this, Tooltip); var _this26 = _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, Tooltip, el, options)); _this26.el.M_Tooltip = _this26; _this26.options = $.extend({}, Tooltip.defaults, options); ...
Construct Tooltip instance @constructor @param {Element} el @param {Object} options
Tooltip
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function getWavesEffectElement(e) { if (TouchHandler.allowEvent(e) === false) { return null; } var element = null; var target = e.target || e.srcElement; while (target.parentNode !== null) { if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) { ...
Delegated click handler for .waves-effect element. returns null when .waves-effect element not in "click tree"
getWavesEffectElement
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT
function showEffect(e) { var element = getWavesEffectElement(e); if (element !== null) { Effect.show(e, element); if ('ontouchstart' in window) { element.addEventListener('touchend', Effect.hide, false); element.addEventListener('touchcancel', Effect.hide, false); } el...
Bubble the click and show effect if .waves-effect elem was found
showEffect
javascript
Dogfalo/materialize
dist/js/materialize.js
https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js
MIT