File manager - Edit - /home/monara/public_html/test.athavaneng.com/tether.tar
Back
LICENSE 0000644 00000002047 15073227372 0005564 0 ustar 00 Copyright (c) 2014-2017 HubSpot, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. src/css/tether.sass 0000644 00000000123 15073227372 0010315 0 ustar 00 @import helpers/tether $themePrefix: "tether" +tether($themePrefix: $themePrefix) src/css/tether-theme-arrows.sass 0000644 00000000617 15073227372 0012740 0 ustar 00 @import helpers/tether @import helpers/tether-theme-arrows $themePrefix: "tether" $themeName: "arrows" $arrowSize: 16px $backgroundColor: #fff $color: inherit $useDropShadow: true +tether($themePrefix: $themePrefix) +tether-theme-arrows($themePrefix: $themePrefix, $themeName: $themeName, $arrowSize: $arrowSize, $backgroundColor: $backgroundColor, $color: $color, $useDropShadow: $useDropShadow) src/css/mixins/_pie-clearfix.sass 0000644 00000000135 15073227372 0013043 0 ustar 00 @mixin pie-clearfix *zoom: 1 &:after content: "" display: table clear: both src/css/mixins/_inline-block.sass 0000644 00000000173 15073227372 0013043 0 ustar 00 @mixin inline-block display: inline-block vertical-align: middle *vertical-align: auto *zoom: 1 *display: inline src/css/helpers/_tether-theme-arrows.sass 0000644 00000016164 15073227372 0014545 0 ustar 00 =tether-theme-arrows($themePrefix: "tether", $themeName: "arrows", $arrowSize: 16px, $arrowPointerEvents: null, $backgroundColor: #fff, $color: inherit, $useDropShadow: false) .#{ $themePrefix }-element.#{ $themePrefix }-theme-#{ $themeName } max-width: 100% max-height: 100% .#{ $themePrefix }-content border-radius: 5px position: relative font-family: inherit background: $backgroundColor color: $color padding: 1em font-size: 1.1em line-height: 1.5em @if $useDropShadow transform: translateZ(0) filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .2)) &:before content: "" display: block position: absolute width: 0 height: 0 border-color: transparent border-width: $arrowSize border-style: solid pointer-events: $arrowPointerEvents // Centers and middles &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-center .#{ $themePrefix }-content margin-bottom: $arrowSize &:before top: 100% left: 50% margin-left: - $arrowSize border-top-color: $backgroundColor border-bottom: 0 &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-center .#{ $themePrefix }-content margin-top: $arrowSize &:before bottom: 100% left: 50% margin-left: - $arrowSize border-bottom-color: $backgroundColor border-top: 0 &.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-element-attached-middle .#{ $themePrefix }-content margin-right: $arrowSize &:before left: 100% top: 50% margin-top: - $arrowSize border-left-color: $backgroundColor border-right: 0 &.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-element-attached-middle .#{ $themePrefix }-content margin-left: $arrowSize &:before right: 100% top: 50% margin-top: - $arrowSize border-right-color: $backgroundColor border-left: 0 // Target middle/center, element corner &.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-center .#{ $themePrefix }-content left: - $arrowSize * 2 &.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-center .#{ $themePrefix }-content left: $arrowSize * 2 &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content margin-top: $arrowSize &:before bottom: 100% left: $arrowSize border-bottom-color: $backgroundColor border-top: 0 &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content margin-top: $arrowSize &:before bottom: 100% right: $arrowSize border-bottom-color: $backgroundColor border-top: 0 &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content margin-bottom: $arrowSize &:before top: 100% left: $arrowSize border-top-color: $backgroundColor border-bottom: 0 &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-middle .#{ $themePrefix }-content margin-bottom: $arrowSize &:before top: 100% right: $arrowSize border-top-color: $backgroundColor border-bottom: 0 // Top and bottom corners &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-bottom .#{ $themePrefix }-content margin-top: $arrowSize &:before bottom: 100% left: $arrowSize border-bottom-color: $backgroundColor border-top: 0 &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-bottom .#{ $themePrefix }-content margin-top: $arrowSize &:before bottom: 100% right: $arrowSize border-bottom-color: $backgroundColor border-top: 0 &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-top .#{ $themePrefix }-content margin-bottom: $arrowSize &:before top: 100% left: $arrowSize border-top-color: $backgroundColor border-bottom: 0 &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-top .#{ $themePrefix }-content margin-bottom: $arrowSize &:before top: 100% right: $arrowSize border-top-color: $backgroundColor border-bottom: 0 // Side corners &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-left .#{ $themePrefix }-content margin-right: $arrowSize &:before top: $arrowSize left: 100% border-left-color: $backgroundColor border-right: 0 &.#{ $themePrefix }-element-attached-top.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-right .#{ $themePrefix }-content margin-left: $arrowSize &:before top: $arrowSize right: 100% border-right-color: $backgroundColor border-left: 0 &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-right.#{ $themePrefix }-target-attached-left .#{ $themePrefix }-content margin-right: $arrowSize &:before bottom: $arrowSize left: 100% border-left-color: $backgroundColor border-right: 0 &.#{ $themePrefix }-element-attached-bottom.#{ $themePrefix }-element-attached-left.#{ $themePrefix }-target-attached-right .#{ $themePrefix }-content margin-left: $arrowSize &:before bottom: $arrowSize right: 100% border-right-color: $backgroundColor border-left: 0 src/css/helpers/_tether-theme-basic.sass 0000644 00000001022 15073227372 0014274 0 ustar 00 =tether-theme-basic($themePrefix: "tether", $themeName: "basic", $backgroundColor: #fff, $color: inherit) .#{ $themePrefix }-element.#{ $themePrefix }-theme-#{ $themeName } max-width: 100% max-height: 100% .#{ $themePrefix }-content border-radius: 5px box-shadow: 0 2px 8px rgba(0, 0, 0, .2) font-family: inherit background: $backgroundColor color: $color padding: 1em font-size: 1.1em line-height: 1.5em src/css/helpers/_tether.sass 0000644 00000000454 15073227372 0012125 0 ustar 00 =tether($themePrefix: "tether") .#{ $themePrefix }-element, .#{ $themePrefix }-element * &, &:after, &:before box-sizing: border-box .#{ $themePrefix }-element position: absolute display: none &.#{ $themePrefix }-open display: block src/css/tether-theme-arrows-dark.sass 0000644 00000000622 15073227372 0013653 0 ustar 00 @import helpers/tether @import helpers/tether-theme-arrows $themePrefix: "tether" $themeName: "arrows-dark" $arrowSize: 16px $backgroundColor: #000 $color: #fff $useDropShadow: false +tether($themePrefix: $themePrefix) +tether-theme-arrows($themePrefix: $themePrefix, $themeName: $themeName, $arrowSize: $arrowSize, $backgroundColor: $backgroundColor, $color: $color, $useDropShadow: $useDropShadow) src/css/tether-theme-basic.sass 0000644 00000000455 15073227372 0012504 0 ustar 00 @import helpers/tether @import helpers/tether-theme-basic $themePrefix: "tether" $themeName: "basic" $backgroundColor: #fff $color: inherit +tether($themePrefix: $themePrefix) +tether-theme-basic($themePrefix: $themePrefix, $themeName: $themeName, $backgroundColor: $backgroundColor, $color: $color) src/js/shift.js 0000644 00000001277 15073227372 0007441 0 ustar 00 /* globals TetherBase */ TetherBase.modules.push({ position({top, left}) { if (!this.options.shift) { return; } let shift = this.options.shift; if (typeof this.options.shift === 'function') { shift = this.options.shift.call(this, {top, left}); } let shiftTop, shiftLeft; if (typeof shift === 'string') { shift = shift.split(' '); shift[1] = shift[1] || shift[0]; ([shiftTop, shiftLeft] = shift); shiftTop = parseFloat(shiftTop, 10); shiftLeft = parseFloat(shiftLeft, 10); } else { ([shiftTop, shiftLeft] = [shift.top, shift.left]); } top += shiftTop; left += shiftLeft; return {top, left}; } }); src/js/markAttachment.js 0000644 00000002060 15073227372 0011256 0 ustar 00 /* globals Tether */ Tether.modules.push({ initialize() { this.markers = {}; ['target', 'element'].forEach(type => { const el = document.createElement('div'); el.className = this.getClass(`${ type }-marker`); const dot = document.createElement('div'); dot.className = this.getClass('marker-dot'); el.appendChild(dot); this[type].appendChild(el); this.markers[type] = {dot, el}; }); }, position({manualOffset, manualTargetOffset}) { const offsets = { element: manualOffset, target: manualTargetOffset }; for (let type in offsets) { const offset = offsets[type]; for (let side in offset) { let val = offset[side]; const notString = typeof val !== 'string'; if (notString || val.indexOf('%') === -1 && val.indexOf('px') === -1) { val += 'px'; } if (this.markers[type].dot.style[side] !== val) { this.markers[type].dot.style[side] = val; } } } return true; } }); src/js/tether.js 0000644 00000055715 15073227372 0007625 0 ustar 00 /* globals TetherBase, performance */ if (typeof TetherBase === 'undefined') { throw new Error('You must include the utils.js file before tether.js'); } const { getScrollParents, getBounds, getOffsetParent, extend, addClass, removeClass, updateClasses, defer, flush, getScrollBarSize, removeUtilElements } = TetherBase.Utils; function within(a, b, diff=1) { return (a + diff >= b && b >= a - diff); } const transformKey = (() => { if(typeof document === 'undefined') { return ''; } const el = document.createElement('div'); const transforms = ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform']; for (let i = 0; i < transforms.length; ++i) { const key = transforms[i]; if (el.style[key] !== undefined) { return key; } } })(); const tethers = []; const position = () => { tethers.forEach(tether => { tether.position(false); }); flush(); }; function now() { if (typeof performance === 'object' && typeof performance.now === 'function') { return performance.now(); } return +new Date; } (() => { let lastCall = null; let lastDuration = null; let pendingTimeout = null; const tick = () => { if (typeof lastDuration !== 'undefined' && lastDuration > 16) { // We voluntarily throttle ourselves if we can't manage 60fps lastDuration = Math.min(lastDuration - 16, 250); // Just in case this is the last event, remember to position just once more pendingTimeout = setTimeout(tick, 250); return; } if (typeof lastCall !== 'undefined' && (now() - lastCall) < 10) { // Some browsers call events a little too frequently, refuse to run more than is reasonable return; } if (pendingTimeout != null) { clearTimeout(pendingTimeout); pendingTimeout = null; } lastCall = now(); position(); lastDuration = now() - lastCall; }; if(typeof window !== 'undefined' && typeof window.addEventListener !== 'undefined') { ['resize', 'scroll', 'touchmove'].forEach(event => { window.addEventListener(event, tick); }); } })(); const MIRROR_LR = { center: 'center', left: 'right', right: 'left' }; const MIRROR_TB = { middle: 'middle', top: 'bottom', bottom: 'top' }; const OFFSET_MAP = { top: 0, left: 0, middle: '50%', center: '50%', bottom: '100%', right: '100%' }; const autoToFixedAttachment = (attachment, relativeToAttachment) => { let {left, top} = attachment; if (left === 'auto') { left = MIRROR_LR[relativeToAttachment.left]; } if (top === 'auto') { top = MIRROR_TB[relativeToAttachment.top]; } return {left, top}; }; const attachmentToOffset = (attachment) => { let left = attachment.left; let top = attachment.top; if (typeof OFFSET_MAP[attachment.left] !== 'undefined') { left = OFFSET_MAP[attachment.left]; } if (typeof OFFSET_MAP[attachment.top] !== 'undefined') { top = OFFSET_MAP[attachment.top]; } return {left, top}; }; function addOffset(...offsets) { const out = {top: 0, left: 0}; offsets.forEach(({top, left}) => { if (typeof top === 'string') { top = parseFloat(top, 10); } if (typeof left === 'string') { left = parseFloat(left, 10); } out.top += top; out.left += left; }); return out; } function offsetToPx(offset, size) { if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) { offset.left = parseFloat(offset.left, 10) / 100 * size.width; } if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) { offset.top = parseFloat(offset.top, 10) / 100 * size.height; } return offset; } const parseOffset = (value) => { const [top, left] = value.split(' '); return {top, left}; }; const parseAttachment = parseOffset; class TetherClass extends Evented { constructor(options) { super(); this.position = this.position.bind(this); tethers.push(this); this.history = []; this.setOptions(options, false); TetherBase.modules.forEach(module => { if (typeof module.initialize !== 'undefined') { module.initialize.call(this); } }); this.position(); } getClass(key='') { const {classes} = this.options; if (typeof classes !== 'undefined' && classes[key]) { return this.options.classes[key]; } else if (this.options.classPrefix) { return `${ this.options.classPrefix }-${ key }`; } else { return key; } } setOptions(options, pos=true) { const defaults = { offset: '0 0', targetOffset: '0 0', targetAttachment: 'auto auto', classPrefix: 'tether' }; this.options = extend(defaults, options); let {element, target, targetModifier} = this.options; this.element = element; this.target = target; this.targetModifier = targetModifier; if (this.target === 'viewport') { this.target = document.body; this.targetModifier = 'visible'; } else if (this.target === 'scroll-handle') { this.target = document.body; this.targetModifier = 'scroll-handle'; } ['element', 'target'].forEach(key => { if (typeof this[key] === 'undefined') { throw new Error('Tether Error: Both element and target must be defined'); } if (typeof this[key].jquery !== 'undefined') { this[key] = this[key][0]; } else if (typeof this[key] === 'string') { this[key] = document.querySelector(this[key]); } }); addClass(this.element, this.getClass('element')); if (!(this.options.addTargetClasses === false)) { addClass(this.target, this.getClass('target')); } if (!this.options.attachment) { throw new Error('Tether Error: You must provide an attachment'); } this.targetAttachment = parseAttachment(this.options.targetAttachment); this.attachment = parseAttachment(this.options.attachment); this.offset = parseOffset(this.options.offset); this.targetOffset = parseOffset(this.options.targetOffset); if (typeof this.scrollParents !== 'undefined') { this.disable(); } if (this.targetModifier === 'scroll-handle') { this.scrollParents = [this.target]; } else { this.scrollParents = getScrollParents(this.target); } if(!(this.options.enabled === false)) { this.enable(pos); } } getTargetBounds() { if (typeof this.targetModifier !== 'undefined') { if (this.targetModifier === 'visible') { if (this.target === document.body) { return {top: pageYOffset, left: pageXOffset, height: innerHeight, width: innerWidth}; } else { const bounds = getBounds(this.target); const out = { height: bounds.height, width: bounds.width, top: bounds.top, left: bounds.left }; out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top)); out.height = Math.min(out.height, bounds.height - ((bounds.top + bounds.height) - (pageYOffset + innerHeight))); out.height = Math.min(innerHeight, out.height); out.height -= 2; out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left)); out.width = Math.min(out.width, bounds.width - ((bounds.left + bounds.width) - (pageXOffset + innerWidth))); out.width = Math.min(innerWidth, out.width); out.width -= 2; if (out.top < pageYOffset) { out.top = pageYOffset; } if (out.left < pageXOffset) { out.left = pageXOffset; } return out; } } else if (this.targetModifier === 'scroll-handle') { let bounds; let target = this.target; if (target === document.body) { target = document.documentElement; bounds = { left: pageXOffset, top: pageYOffset, height: innerHeight, width: innerWidth }; } else { bounds = getBounds(target); } const style = getComputedStyle(target); const hasBottomScroll = ( target.scrollWidth > target.clientWidth || [style.overflow, style.overflowX].indexOf('scroll') >= 0 || this.target !== document.body ); let scrollBottom = 0; if (hasBottomScroll) { scrollBottom = 15; } const height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom; const out = { width: 15, height: height * 0.975 * (height / target.scrollHeight), left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15 }; let fitAdj = 0; if (height < 408 && this.target === document.body) { fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58; } if (this.target !== document.body) { out.height = Math.max(out.height, 24); } const scrollPercentage = this.target.scrollTop / (target.scrollHeight - height); out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth); if (this.target === document.body) { out.height = Math.max(out.height, 24); } return out; } } else { return getBounds(this.target); } } clearCache() { this._cache = {}; } cache(k, getter) { // More than one module will often need the same DOM info, so // we keep a cache which is cleared on each position call if (typeof this._cache === 'undefined') { this._cache = {}; } if (typeof this._cache[k] === 'undefined') { this._cache[k] = getter.call(this); } return this._cache[k]; } enable(pos=true) { if (!(this.options.addTargetClasses === false)) { addClass(this.target, this.getClass('enabled')); } addClass(this.element, this.getClass('enabled')); this.enabled = true; this.scrollParents.forEach((parent) => { if (parent !== this.target.ownerDocument) { parent.addEventListener('scroll', this.position); } }) if (pos) { this.position(); } } disable() { removeClass(this.target, this.getClass('enabled')); removeClass(this.element, this.getClass('enabled')); this.enabled = false; if (typeof this.scrollParents !== 'undefined') { this.scrollParents.forEach((parent) => { parent.removeEventListener('scroll', this.position); }) } } destroy() { this.disable(); tethers.forEach((tether, i) => { if (tether === this) { tethers.splice(i, 1); } }); // Remove any elements we were using for convenience from the DOM if (tethers.length === 0) { removeUtilElements(); } } updateAttachClasses(elementAttach, targetAttach) { elementAttach = elementAttach || this.attachment; targetAttach = targetAttach || this.targetAttachment; const sides = ['left', 'top', 'bottom', 'right', 'middle', 'center']; if (typeof this._addAttachClasses !== 'undefined' && this._addAttachClasses.length) { // updateAttachClasses can be called more than once in a position call, so // we need to clean up after ourselves such that when the last defer gets // ran it doesn't add any extra classes from previous calls. this._addAttachClasses.splice(0, this._addAttachClasses.length); } if (typeof this._addAttachClasses === 'undefined') { this._addAttachClasses = []; } const add = this._addAttachClasses; if (elementAttach.top) { add.push(`${ this.getClass('element-attached') }-${ elementAttach.top }`); } if (elementAttach.left) { add.push(`${ this.getClass('element-attached') }-${ elementAttach.left }`); } if (targetAttach.top) { add.push(`${ this.getClass('target-attached') }-${ targetAttach.top }`); } if (targetAttach.left) { add.push(`${ this.getClass('target-attached') }-${ targetAttach.left }`); } const all = []; sides.forEach(side => { all.push(`${ this.getClass('element-attached') }-${ side }`); all.push(`${ this.getClass('target-attached') }-${ side }`); }); defer(() => { if (!(typeof this._addAttachClasses !== 'undefined')) { return; } updateClasses(this.element, this._addAttachClasses, all); if (!(this.options.addTargetClasses === false)) { updateClasses(this.target, this._addAttachClasses, all); } delete this._addAttachClasses; }); } position(flushChanges=true) { // flushChanges commits the changes immediately, leave true unless you are positioning multiple // tethers (in which case call Tether.Utils.flush yourself when you're done) if (!this.enabled) { return; } this.clearCache(); // Turn 'auto' attachments into the appropriate corner or edge const targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment); this.updateAttachClasses(this.attachment, targetAttachment); const elementPos = this.cache('element-bounds', () => { return getBounds(this.element); }); let {width, height} = elementPos; if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') { // We cache the height and width to make it possible to position elements that are // getting hidden. ({width, height} = this.lastSize); } else { this.lastSize = {width, height}; } const targetPos = this.cache('target-bounds', () => { return this.getTargetBounds(); }); const targetSize = targetPos; // Get an actual px offset from the attachment let offset = offsetToPx(attachmentToOffset(this.attachment), {width, height}); let targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize); const manualOffset = offsetToPx(this.offset, {width, height}); const manualTargetOffset = offsetToPx(this.targetOffset, targetSize); // Add the manually provided offset offset = addOffset(offset, manualOffset); targetOffset = addOffset(targetOffset, manualTargetOffset); // It's now our goal to make (element position + offset) == (target position + target offset) let left = targetPos.left + targetOffset.left - offset.left; let top = targetPos.top + targetOffset.top - offset.top; for (let i = 0; i < TetherBase.modules.length; ++i) { const module = TetherBase.modules[i]; const ret = module.position.call(this, { left, top, targetAttachment, targetPos, elementPos, offset, targetOffset, manualOffset, manualTargetOffset, scrollbarSize, attachment: this.attachment }); if (ret === false) { return false; } else if (typeof ret === 'undefined' || typeof ret !== 'object') { continue; } else { ({top, left} = ret); } } // We describe the position three different ways to give the optimizer // a chance to decide the best possible way to position the element // with the fewest repaints. const next = { // It's position relative to the page (absolute positioning when // the element is a child of the body) page: { top: top, left: left }, // It's position relative to the viewport (fixed positioning) viewport: { top: top - pageYOffset, bottom: pageYOffset - top - height + innerHeight, left: left - pageXOffset, right: pageXOffset - left - width + innerWidth } }; var doc = this.target.ownerDocument; var win = doc.defaultView; let scrollbarSize; if (win.innerHeight > doc.documentElement.clientHeight) { scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); next.viewport.bottom -= scrollbarSize.height; } if (win.innerWidth > doc.documentElement.clientWidth) { scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); next.viewport.right -= scrollbarSize.width; } if (['', 'static'].indexOf(doc.body.style.position) === -1 || ['', 'static'].indexOf(doc.body.parentElement.style.position) === -1) { // Absolute positioning in the body will be relative to the page, not the 'initial containing block' next.page.bottom = doc.body.scrollHeight - top - height; next.page.right = doc.body.scrollWidth - left - width; } if (typeof this.options.optimizations !== 'undefined' && this.options.optimizations.moveElement !== false && !(typeof this.targetModifier !== 'undefined')) { const offsetParent = this.cache('target-offsetparent', () => getOffsetParent(this.target)); const offsetPosition = this.cache('target-offsetparent-bounds', () => getBounds(offsetParent)); const offsetParentStyle = getComputedStyle(offsetParent); const offsetParentSize = offsetPosition; const offsetBorder = {}; ['Top', 'Left', 'Bottom', 'Right'].forEach(side => { offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle[`border${ side }Width`]); }); offsetPosition.right = doc.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right; offsetPosition.bottom = doc.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom; if (next.page.top >= (offsetPosition.top + offsetBorder.top) && next.page.bottom >= offsetPosition.bottom) { if (next.page.left >= (offsetPosition.left + offsetBorder.left) && next.page.right >= offsetPosition.right) { // We're within the visible part of the target's scroll parent const scrollTop = offsetParent.scrollTop; const scrollLeft = offsetParent.scrollLeft; // It's position relative to the target's offset parent (absolute positioning when // the element is moved to be a child of the target's offset parent). next.offset = { top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top, left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left }; } } } // We could also travel up the DOM and try each containing context, rather than only // looking at the body, but we're gonna get diminishing returns. this.move(next); this.history.unshift(next); if (this.history.length > 3) { this.history.pop(); } if (flushChanges) { flush(); } return true; } // THE ISSUE move(pos) { if (!(typeof this.element.parentNode !== 'undefined')) { return; } const same = {}; for (let type in pos) { same[type] = {}; for (let key in pos[type]) { let found = false; for (let i = 0; i < this.history.length; ++i) { const point = this.history[i]; if (typeof point[type] !== 'undefined' && !within(point[type][key], pos[type][key])) { found = true; break; } } if (!found) { same[type][key] = true; } } } let css = {top: '', left: '', right: '', bottom: ''}; const transcribe = (_same, _pos) => { const hasOptimizations = typeof this.options.optimizations !== 'undefined'; const gpu = hasOptimizations ? this.options.optimizations.gpu : null; if (gpu !== false) { let yPos, xPos; if (_same.top) { css.top = 0; yPos = _pos.top; } else { css.bottom = 0; yPos = -_pos.bottom; } if (_same.left) { css.left = 0; xPos = _pos.left; } else { css.right = 0; xPos = -_pos.right; } if (typeof window.devicePixelRatio === 'number' && devicePixelRatio % 1 === 0) { xPos = Math.round(xPos * devicePixelRatio) / devicePixelRatio; yPos = Math.round(yPos * devicePixelRatio) / devicePixelRatio; } css[transformKey] = `translateX(${ xPos }px) translateY(${ yPos }px)`; if (transformKey !== 'msTransform') { // The Z transform will keep this in the GPU (faster, and prevents artifacts), // but IE9 doesn't support 3d transforms and will choke. css[transformKey] += " translateZ(0)"; } } else { if (_same.top) { css.top = `${ _pos.top }px`; } else { css.bottom = `${ _pos.bottom }px`; } if (_same.left) { css.left = `${ _pos.left }px`; } else { css.right = `${ _pos.right }px`; } } }; let moved = false; if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) { css.position = 'absolute'; transcribe(same.page, pos.page); } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) { css.position = 'fixed'; transcribe(same.viewport, pos.viewport); } else if (typeof same.offset !== 'undefined' && same.offset.top && same.offset.left) { css.position = 'absolute'; const offsetParent = this.cache('target-offsetparent', () => getOffsetParent(this.target)); if (getOffsetParent(this.element) !== offsetParent) { defer(() => { this.element.parentNode.removeChild(this.element); offsetParent.appendChild(this.element); }); } transcribe(same.offset, pos.offset); moved = true; } else { css.position = 'absolute'; transcribe({top: true, left: true}, pos.page); } if (!moved) { if (this.options.bodyElement) { if (this.element.parentNode !== this.options.bodyElement) { this.options.bodyElement.appendChild(this.element); } } else { let offsetParentIsBody = true; function isFullscreenElement(e) { let d = e.ownerDocument; let fe = d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement || d.msFullscreenElement; return fe === e; } let currentNode = this.element.parentNode; while (currentNode && currentNode.nodeType === 1 && currentNode.tagName !== 'BODY' && !isFullscreenElement(currentNode)) { if (getComputedStyle(currentNode).position !== 'static') { offsetParentIsBody = false; break; } currentNode = currentNode.parentNode; } if (!offsetParentIsBody) { this.element.parentNode.removeChild(this.element); this.element.ownerDocument.body.appendChild(this.element); } } } // Any css change will trigger a repaint, so let's avoid one if nothing changed const writeCSS = {}; let write = false; for (let key in css) { let val = css[key]; let elVal = this.element.style[key]; if (elVal !== val) { write = true; writeCSS[key] = val; } } if (write) { defer(() => { extend(this.element.style, writeCSS); this.trigger('repositioned'); }); } } } TetherClass.modules = []; TetherBase.position = position; let Tether = extend(TetherClass, TetherBase); src/js/abutment.js 0000644 00000003117 15073227372 0010136 0 ustar 00 /* globals TetherBase */ const {getBounds, updateClasses, defer} = TetherBase.Utils; TetherBase.modules.push({ position({top, left}) { const {height, width} = this.cache('element-bounds', () => { return getBounds(this.element); }); const targetPos = this.getTargetBounds(); const bottom = top + height; const right = left + width; const abutted = []; if (top <= targetPos.bottom && bottom >= targetPos.top) { ['left', 'right'].forEach(side => { const targetPosSide = targetPos[side]; if (targetPosSide === left || targetPosSide === right) { abutted.push(side); } }); } if (left <= targetPos.right && right >= targetPos.left) { ['top', 'bottom'].forEach(side => { const targetPosSide = targetPos[side]; if (targetPosSide === top || targetPosSide === bottom) { abutted.push(side); } }); } const allClasses = []; const addClasses = []; const sides = ['left', 'top', 'right', 'bottom']; allClasses.push(this.getClass('abutted')); sides.forEach(side => { allClasses.push(`${ this.getClass('abutted') }-${ side }`); }); if (abutted.length) { addClasses.push(this.getClass('abutted')); } abutted.forEach(side => { addClasses.push(`${ this.getClass('abutted') }-${ side }`); }); defer(() => { if (!(this.options.addTargetClasses === false)) { updateClasses(this.target, addClasses, allClasses); } updateClasses(this.element, addClasses, allClasses); }); return true; } }); src/js/utils.js 0000644 00000021363 15073227372 0007462 0 ustar 00 let TetherBase; if (typeof TetherBase === 'undefined') { TetherBase = {modules: []}; } let zeroElement = null; // Same as native getBoundingClientRect, except it takes into account parent <frame> offsets // if the element lies within a nested document (<frame> or <iframe>-like). function getActualBoundingClientRect(node) { let boundingRect = node.getBoundingClientRect(); // The original object returned by getBoundingClientRect is immutable, so we clone it // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9 let rect = {}; for (var k in boundingRect) { rect[k] = boundingRect[k]; } try { if (node.ownerDocument !== document) { let frameElement = node.ownerDocument.defaultView.frameElement; if (frameElement) { let frameRect = getActualBoundingClientRect(frameElement); rect.top += frameRect.top; rect.bottom += frameRect.top; rect.left += frameRect.left; rect.right += frameRect.left; } } } catch (err) { // Ignore "Access is denied" in IE11/Edge } return rect; } function getScrollParents(el) { // In firefox if the el is inside an iframe with display: none; window.getComputedStyle() will return null; // https://bugzilla.mozilla.org/show_bug.cgi?id=548397 const computedStyle = getComputedStyle(el) || {}; const position = computedStyle.position; let parents = []; if (position === 'fixed') { return [el]; } let parent = el; while ((parent = parent.parentNode) && parent && parent.nodeType === 1) { let style; try { style = getComputedStyle(parent); } catch (err) {} if (typeof style === 'undefined' || style === null) { parents.push(parent); return parents; } const {overflow, overflowX, overflowY} = style; if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { if (position !== 'absolute' || ['relative', 'absolute', 'fixed'].indexOf(style.position) >= 0) { parents.push(parent) } } } parents.push(el.ownerDocument.body); // If the node is within a frame, account for the parent window scroll if (el.ownerDocument !== document) { parents.push(el.ownerDocument.defaultView); } return parents; } const uniqueId = (() => { let id = 0; return () => ++id; })(); const zeroPosCache = {}; const getOrigin = () => { // getBoundingClientRect is unfortunately too accurate. It introduces a pixel or two of // jitter as the user scrolls that messes with our ability to detect if two positions // are equivilant or not. We place an element at the top left of the page that will // get the same jitter, so we can cancel the two out. let node = zeroElement; if (!node || !document.body.contains(node)) { node = document.createElement('div'); node.setAttribute('data-tether-id', uniqueId()); extend(node.style, { top: 0, left: 0, position: 'absolute' }); document.body.appendChild(node); zeroElement = node; } const id = node.getAttribute('data-tether-id'); if (typeof zeroPosCache[id] === 'undefined') { zeroPosCache[id] = getActualBoundingClientRect(node); // Clear the cache when this position call is done defer(() => { delete zeroPosCache[id]; }); } return zeroPosCache[id]; }; function removeUtilElements() { if (zeroElement) { document.body.removeChild(zeroElement); } zeroElement = null; }; function getBounds(el) { let doc; if (el === document) { doc = document; el = document.documentElement; } else { doc = el.ownerDocument; } const docEl = doc.documentElement; const box = getActualBoundingClientRect(el); const origin = getOrigin(); box.top -= origin.top; box.left -= origin.left; if (typeof box.width === 'undefined') { box.width = document.body.scrollWidth - box.left - box.right; } if (typeof box.height === 'undefined') { box.height = document.body.scrollHeight - box.top - box.bottom; } box.top = box.top - docEl.clientTop; box.left = box.left - docEl.clientLeft; box.right = doc.body.clientWidth - box.width - box.left; box.bottom = doc.body.clientHeight - box.height - box.top; return box; } function getOffsetParent(el) { return el.offsetParent || document.documentElement; } let _scrollBarSize = null; function getScrollBarSize() { if (_scrollBarSize) { return _scrollBarSize; } const inner = document.createElement('div'); inner.style.width = '100%'; inner.style.height = '200px'; const outer = document.createElement('div'); extend(outer.style, { position: 'absolute', top: 0, left: 0, pointerEvents: 'none', visibility: 'hidden', width: '200px', height: '150px', overflow: 'hidden' }); outer.appendChild(inner); document.body.appendChild(outer); const widthContained = inner.offsetWidth; outer.style.overflow = 'scroll'; let widthScroll = inner.offsetWidth; if (widthContained === widthScroll) { widthScroll = outer.clientWidth; } document.body.removeChild(outer); const width = widthContained - widthScroll; _scrollBarSize = {width, height: width}; return _scrollBarSize; } function extend(out={}) { const args = []; Array.prototype.push.apply(args, arguments); args.slice(1).forEach(obj => { if (obj) { for (let key in obj) { if ({}.hasOwnProperty.call(obj, key)) { out[key] = obj[key]; } } } }); return out; } function removeClass(el, name) { if (typeof el.classList !== 'undefined') { name.split(' ').forEach(cls => { if (cls.trim()) { el.classList.remove(cls); } }); } else { const regex = new RegExp(`(^| )${ name.split(' ').join('|') }( |$)`, 'gi'); const className = getClassName(el).replace(regex, ' '); setClassName(el, className); } } function addClass(el, name) { if (typeof el.classList !== 'undefined') { name.split(' ').forEach(cls => { if (cls.trim()) { el.classList.add(cls); } }); } else { removeClass(el, name); const cls = getClassName(el) + ` ${name}`; setClassName(el, cls); } } function hasClass(el, name) { if (typeof el.classList !== 'undefined') { return el.classList.contains(name); } const className = getClassName(el); return new RegExp(`(^| )${ name }( |$)`, 'gi').test(className); } function getClassName(el) { // Can't use just SVGAnimatedString here since nodes within a Frame in IE have // completely separately SVGAnimatedString base classes if (el.className instanceof el.ownerDocument.defaultView.SVGAnimatedString) { return el.className.baseVal; } return el.className; } function setClassName(el, className) { el.setAttribute('class', className); } function updateClasses(el, add, all) { // Of the set of 'all' classes, we need the 'add' classes, and only the // 'add' classes to be set. all.forEach(cls => { if (add.indexOf(cls) === -1 && hasClass(el, cls)) { removeClass(el, cls); } }); add.forEach(cls => { if (!hasClass(el, cls)) { addClass(el, cls); } }); } const deferred = []; const defer = (fn) => { deferred.push(fn); }; const flush = () => { let fn; while(fn = deferred.pop()) { fn(); } }; class Evented { on(event, handler, ctx, once=false) { if (typeof this.bindings === 'undefined') { this.bindings = {}; } if (typeof this.bindings[event] === 'undefined') { this.bindings[event] = []; } this.bindings[event].push({handler, ctx, once}); } once(event, handler, ctx) { this.on(event, handler, ctx, true); } off(event, handler) { if (typeof this.bindings === 'undefined' || typeof this.bindings[event] === 'undefined') { return; } if (typeof handler === 'undefined') { delete this.bindings[event]; } else { let i = 0; while (i < this.bindings[event].length) { if (this.bindings[event][i].handler === handler) { this.bindings[event].splice(i, 1); } else { ++i; } } } } trigger(event, ...args) { if (typeof this.bindings !== 'undefined' && this.bindings[event]) { let i = 0; while (i < this.bindings[event].length) { const {handler, ctx, once} = this.bindings[event][i]; let context = ctx; if (typeof context === 'undefined') { context = this; } handler.apply(context, args); if (once) { this.bindings[event].splice(i, 1); } else { ++i; } } } } } TetherBase.Utils = { getActualBoundingClientRect, getScrollParents, getBounds, getOffsetParent, extend, addClass, removeClass, hasClass, updateClasses, defer, flush, uniqueId, Evented, getScrollBarSize, removeUtilElements }; src/js/constraint.js 0000644 00000024117 15073227372 0010506 0 ustar 00 /* globals TetherBase */ const { getBounds, extend, updateClasses, defer } = TetherBase.Utils; const BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom']; function getBoundingRect(tether, to) { if (to === 'scrollParent') { to = tether.scrollParents[0]; } else if (to === 'window') { to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset]; } if (to === document) { to = to.documentElement; } if (typeof to.nodeType !== 'undefined') { const node = to; const size = getBounds(to); const pos = size; const style = getComputedStyle(to); to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top]; // Account any parent Frames scroll offset if (node.ownerDocument !== document) { let win = node.ownerDocument.defaultView; to[0] += win.pageXOffset; to[1] += win.pageYOffset; to[2] += win.pageXOffset; to[3] += win.pageYOffset; } BOUNDS_FORMAT.forEach((side, i) => { side = side[0].toUpperCase() + side.substr(1); if (side === 'Top' || side === 'Left') { to[i] += parseFloat(style[`border${ side }Width`]); } else { to[i] -= parseFloat(style[`border${ side }Width`]); } }); } return to; } TetherBase.modules.push({ position({top, left, targetAttachment}) { if (!this.options.constraints) { return true; } let {height, width} = this.cache('element-bounds', () => { return getBounds(this.element); }); if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') { // Handle the item getting hidden as a result of our positioning without glitching // the classes in and out ({width, height} = this.lastSize); } const targetSize = this.cache('target-bounds', () => { return this.getTargetBounds(); }); const {height: targetHeight, width: targetWidth} = targetSize; const allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')]; this.options.constraints.forEach(constraint => { const {outOfBoundsClass, pinnedClass} = constraint; if (outOfBoundsClass) { allClasses.push(outOfBoundsClass); } if (pinnedClass) { allClasses.push(pinnedClass); } }); allClasses.forEach(cls => { ['left', 'top', 'right', 'bottom'].forEach(side => { allClasses.push(`${ cls }-${ side }`); }); }); const addClasses = []; const tAttachment = extend({}, targetAttachment); const eAttachment = extend({}, this.attachment); this.options.constraints.forEach(constraint => { let {to, attachment, pin} = constraint; if (typeof attachment === 'undefined') { attachment = ''; } let changeAttachX, changeAttachY; if (attachment.indexOf(' ') >= 0) { [changeAttachY, changeAttachX] = attachment.split(' '); } else { changeAttachX = changeAttachY = attachment; } const bounds = getBoundingRect(this, to); if (changeAttachY === 'target' || changeAttachY === 'both') { if (top < bounds[1] && tAttachment.top === 'top') { top += targetHeight; tAttachment.top = 'bottom'; } if (top + height > bounds[3] && tAttachment.top === 'bottom') { top -= targetHeight; tAttachment.top = 'top'; } } if (changeAttachY === 'together') { if (tAttachment.top === 'top') { if (eAttachment.top === 'bottom' && top < bounds[1]) { top += targetHeight; tAttachment.top = 'bottom'; top += height; eAttachment.top = 'top'; } else if (eAttachment.top === 'top' && top + height > bounds[3] && top - (height - targetHeight) >= bounds[1]) { top -= height - targetHeight; tAttachment.top = 'bottom'; eAttachment.top = 'bottom'; } } if (tAttachment.top === 'bottom') { if (eAttachment.top === 'top' && top + height > bounds[3]) { top -= targetHeight; tAttachment.top = 'top'; top -= height; eAttachment.top = 'bottom'; } else if (eAttachment.top === 'bottom'&& top < bounds[1] && top + (height*2 - targetHeight) <= bounds[3]) { top += height - targetHeight; tAttachment.top = 'top'; eAttachment.top = 'top'; } } if (tAttachment.top === 'middle') { if (top + height > bounds[3] && eAttachment.top === 'top') { top -= height; eAttachment.top = 'bottom'; } else if (top < bounds[1] && eAttachment.top === 'bottom') { top += height; eAttachment.top = 'top'; } } } if (changeAttachX === 'target' || changeAttachX === 'both') { if (left < bounds[0] && tAttachment.left === 'left') { left += targetWidth; tAttachment.left = 'right'; } if (left + width > bounds[2] && tAttachment.left === 'right') { left -= targetWidth; tAttachment.left = 'left'; } } if (changeAttachX === 'together') { if (left < bounds[0] && tAttachment.left === 'left') { if (eAttachment.left === 'right') { left += targetWidth; tAttachment.left = 'right'; left += width; eAttachment.left = 'left'; } else if (eAttachment.left === 'left') { left += targetWidth; tAttachment.left = 'right'; left -= width; eAttachment.left = 'right'; } } else if (left + width > bounds[2] && tAttachment.left === 'right') { if (eAttachment.left === 'left') { left -= targetWidth; tAttachment.left = 'left'; left -= width; eAttachment.left = 'right'; } else if (eAttachment.left === 'right') { left -= targetWidth; tAttachment.left = 'left'; left += width; eAttachment.left = 'left'; } } else if (tAttachment.left === 'center') { if (left + width > bounds[2] && eAttachment.left === 'left') { left -= width; eAttachment.left = 'right'; } else if (left < bounds[0] && eAttachment.left === 'right') { left += width; eAttachment.left = 'left'; } } } if (changeAttachY === 'element' || changeAttachY === 'both') { if (top < bounds[1] && eAttachment.top === 'bottom') { top += height; eAttachment.top = 'top'; } if (top + height > bounds[3] && eAttachment.top === 'top') { top -= height; eAttachment.top = 'bottom'; } } if (changeAttachX === 'element' || changeAttachX === 'both') { if (left < bounds[0]) { if (eAttachment.left === 'right') { left += width; eAttachment.left = 'left'; } else if (eAttachment.left === 'center') { left += (width / 2); eAttachment.left = 'left'; } } if (left + width > bounds[2]) { if (eAttachment.left === 'left') { left -= width; eAttachment.left = 'right'; } else if (eAttachment.left === 'center') { left -= (width / 2); eAttachment.left = 'right'; } } } if (typeof pin === 'string') { pin = pin.split(',').map(p => p.trim()); } else if (pin === true) { pin = ['top', 'left', 'right', 'bottom']; } pin = pin || []; const pinned = []; const oob = []; if (top < bounds[1]) { if (pin.indexOf('top') >= 0) { top = bounds[1]; pinned.push('top'); } else { oob.push('top'); } } if (top + height > bounds[3]) { if (pin.indexOf('bottom') >= 0) { top = bounds[3] - height; pinned.push('bottom'); } else { oob.push('bottom'); } } if (left < bounds[0]) { if (pin.indexOf('left') >= 0) { left = bounds[0]; pinned.push('left'); } else { oob.push('left'); } } if (left + width > bounds[2]) { if (pin.indexOf('right') >= 0) { left = bounds[2] - width; pinned.push('right'); } else { oob.push('right'); } } if (pinned.length) { let pinnedClass; if (typeof this.options.pinnedClass !== 'undefined') { pinnedClass = this.options.pinnedClass; } else { pinnedClass = this.getClass('pinned'); } addClasses.push(pinnedClass); pinned.forEach(side => { addClasses.push(`${ pinnedClass }-${ side }`); }); } if (oob.length) { let oobClass; if (typeof this.options.outOfBoundsClass !== 'undefined') { oobClass = this.options.outOfBoundsClass; } else { oobClass = this.getClass('out-of-bounds'); } addClasses.push(oobClass); oob.forEach(side => { addClasses.push(`${ oobClass }-${ side }`); }); } if (pinned.indexOf('left') >= 0 || pinned.indexOf('right') >= 0) { eAttachment.left = tAttachment.left = false; } if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) { eAttachment.top = tAttachment.top = false; } if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== this.attachment.top || eAttachment.left !== this.attachment.left) { this.updateAttachClasses(eAttachment, tAttachment); this.trigger('update', { attachment: eAttachment, targetAttachment: tAttachment, }); } }); defer(() => { if (!(this.options.addTargetClasses === false)) { updateClasses(this.target, addClasses, allClasses); } updateClasses(this.element, addClasses, allClasses); }); return {top, left}; } }); dist/css/tether-theme-arrows-dark.min.css 0000644 00000014637 15073227372 0014443 0 ustar 00 .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-center .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content{margin-bottom:16px}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-right.tether-element-attached-middle .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content{margin-right:16px}.tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-arrows-dark{max-width:100%;max-height:100%}.tether-element.tether-theme-arrows-dark .tether-content{border-radius:5px;position:relative;font-family:inherit;background:#000;color:#fff;padding:1em;font-size:1.1em;line-height:1.5em}.tether-element.tether-theme-arrows-dark .tether-content:before{content:"";display:block;position:absolute;width:0;height:0;border-color:transparent;border-width:16px;border-style:solid}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-center .tether-content:before{top:100%;left:50%;margin-left:-16px;border-top-color:#000;border-bottom:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-center .tether-content{margin-top:16px}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-center .tether-content:before{bottom:100%;left:50%;margin-left:-16px;border-bottom-color:#000;border-top:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-left.tether-element-attached-middle .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content{margin-left:16px}.tether-element.tether-theme-arrows-dark.tether-element-attached-right.tether-element-attached-middle .tether-content:before{left:100%;top:50%;margin-top:-16px;border-left-color:#000;border-right:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-left.tether-element-attached-middle .tether-content:before{right:100%;top:50%;margin-top:-16px;border-right-color:#000;border-left:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content,.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content{margin-top:16px}.tether-element.tether-theme-arrows-dark.tether-element-attached-left.tether-target-attached-center .tether-content{left:-32px}.tether-element.tether-theme-arrows-dark.tether-element-attached-right.tether-target-attached-center .tether-content{left:32px}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content:before{bottom:100%;left:16px;border-bottom-color:#000;border-top:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content:before{bottom:100%;right:16px;border-bottom-color:#000;border-top:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content:before{top:100%;left:16px;border-top-color:#000;border-bottom:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content:before{top:100%;right:16px;border-top-color:#000;border-bottom:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content:before{bottom:100%;left:16px;border-bottom-color:#000;border-top:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content:before{bottom:100%;right:16px;border-bottom-color:#000;border-top:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content:before{top:100%;left:16px;border-top-color:#000;border-bottom:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content:before{top:100%;right:16px;border-top-color:#000;border-bottom:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content:before{top:16px;left:100%;border-left-color:#000;border-right:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content:before{top:16px;right:100%;border-right-color:#000;border-left:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content:before{bottom:16px;left:100%;border-left-color:#000;border-right:0}.tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content:before{bottom:16px;right:100%;border-right-color:#000;border-left:0} dist/css/tether.css 0000644 00000000425 15073227372 0010315 0 ustar 00 .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before { box-sizing: border-box; } .tether-element { position: absolute; display: none; } .tether-element.tether-open { display: block; } dist/css/tether-theme-basic.css 0000644 00000001147 15073227372 0012476 0 ustar 00 .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before { box-sizing: border-box; } .tether-element { position: absolute; display: none; } .tether-element.tether-open { display: block; } .tether-element.tether-theme-basic { max-width: 100%; max-height: 100%; } .tether-element.tether-theme-basic .tether-content { border-radius: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); font-family: inherit; background: #fff; color: inherit; padding: 1em; font-size: 1.1em; line-height: 1.5em; } dist/css/tether-theme-arrows-dark.css 0000644 00000017214 15073227372 0013653 0 ustar 00 .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before { box-sizing: border-box; } .tether-element { position: absolute; display: none; } .tether-element.tether-open { display: block; } .tether-element.tether-theme-arrows-dark { max-width: 100%; max-height: 100%; } .tether-element.tether-theme-arrows-dark .tether-content { border-radius: 5px; position: relative; font-family: inherit; background: #000; color: #fff; padding: 1em; font-size: 1.1em; line-height: 1.5em; } .tether-element.tether-theme-arrows-dark .tether-content:before { content: ""; display: block; position: absolute; width: 0; height: 0; border-color: transparent; border-width: 16px; border-style: solid; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-center .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-center .tether-content:before { top: 100%; left: 50%; margin-left: -16px; border-top-color: #000; border-bottom: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-center .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-center .tether-content:before { bottom: 100%; left: 50%; margin-left: -16px; border-bottom-color: #000; border-top: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-right.tether-element-attached-middle .tether-content { margin-right: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-right.tether-element-attached-middle .tether-content:before { left: 100%; top: 50%; margin-top: -16px; border-left-color: #000; border-right: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-left.tether-element-attached-middle .tether-content { margin-left: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-left.tether-element-attached-middle .tether-content:before { right: 100%; top: 50%; margin-top: -16px; border-right-color: #000; border-left: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-left.tether-target-attached-center .tether-content { left: -32px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-right.tether-target-attached-center .tether-content { left: 32px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content:before { bottom: 100%; left: 16px; border-bottom-color: #000; border-top: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content:before { bottom: 100%; right: 16px; border-bottom-color: #000; border-top: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content:before { top: 100%; left: 16px; border-top-color: #000; border-bottom: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content:before { top: 100%; right: 16px; border-top-color: #000; border-bottom: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content:before { bottom: 100%; left: 16px; border-bottom-color: #000; border-top: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content:before { bottom: 100%; right: 16px; border-bottom-color: #000; border-top: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content:before { top: 100%; left: 16px; border-top-color: #000; border-bottom: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content:before { top: 100%; right: 16px; border-top-color: #000; border-bottom: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content { margin-right: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content:before { top: 16px; left: 100%; border-left-color: #000; border-right: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content { margin-left: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content:before { top: 16px; right: 100%; border-right-color: #000; border-left: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content { margin-right: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content:before { bottom: 16px; left: 100%; border-left-color: #000; border-right: 0; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content { margin-left: 16px; } .tether-element.tether-theme-arrows-dark.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content:before { bottom: 16px; right: 100%; border-right-color: #000; border-left: 0; } dist/css/tether-theme-arrows.min.css 0000644 00000014611 15073227372 0013514 0 ustar 00 .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-center .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content{margin-bottom:16px}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-right.tether-element-attached-middle .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content{margin-right:16px}.tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-arrows{max-width:100%;max-height:100%}.tether-element.tether-theme-arrows .tether-content{border-radius:5px;position:relative;font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-filter:drop-shadow(0 1px 4px rgba(0, 0, 0, .2));filter:drop-shadow(0 1px 4px rgba(0, 0, 0, .2))}.tether-element.tether-theme-arrows .tether-content:before{content:"";display:block;position:absolute;width:0;height:0;border-color:transparent;border-width:16px;border-style:solid}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-center .tether-content:before{top:100%;left:50%;margin-left:-16px;border-top-color:#fff;border-bottom:0}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-center .tether-content{margin-top:16px}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-center .tether-content:before{bottom:100%;left:50%;margin-left:-16px;border-bottom-color:#fff;border-top:0}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-left.tether-element-attached-middle .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content{margin-left:16px}.tether-element.tether-theme-arrows.tether-element-attached-right.tether-element-attached-middle .tether-content:before{left:100%;top:50%;margin-top:-16px;border-left-color:#fff;border-right:0}.tether-element.tether-theme-arrows.tether-element-attached-left.tether-element-attached-middle .tether-content:before{right:100%;top:50%;margin-top:-16px;border-right-color:#fff;border-left:0}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content,.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content{margin-top:16px}.tether-element.tether-theme-arrows.tether-element-attached-left.tether-target-attached-center .tether-content{left:-32px}.tether-element.tether-theme-arrows.tether-element-attached-right.tether-target-attached-center .tether-content{left:32px}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content:before{bottom:100%;left:16px;border-bottom-color:#fff;border-top:0}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content:before{bottom:100%;right:16px;border-bottom-color:#fff;border-top:0}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content:before{top:100%;left:16px;border-top-color:#fff;border-bottom:0}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content:before{top:100%;right:16px;border-top-color:#fff;border-bottom:0}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content:before{bottom:100%;left:16px;border-bottom-color:#fff;border-top:0}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content:before{bottom:100%;right:16px;border-bottom-color:#fff;border-top:0}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content:before{top:100%;left:16px;border-top-color:#fff;border-bottom:0}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content:before{top:100%;right:16px;border-top-color:#fff;border-bottom:0}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content:before{top:16px;left:100%;border-left-color:#fff;border-right:0}.tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content:before{top:16px;right:100%;border-right-color:#fff;border-left:0}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content:before{bottom:16px;left:100%;border-left-color:#fff;border-right:0}.tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content:before{bottom:16px;right:100%;border-right-color:#fff;border-left:0} dist/css/tether-theme-basic.min.css 0000644 00000000770 15073227372 0013261 0 ustar 00 .tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em} dist/css/tether.min.css 0000644 00000000355 15073227372 0011101 0 ustar 00 .tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block} dist/css/tether-theme-arrows.css 0000644 00000017240 15073227372 0012733 0 ustar 00 .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before { box-sizing: border-box; } .tether-element { position: absolute; display: none; } .tether-element.tether-open { display: block; } .tether-element.tether-theme-arrows { max-width: 100%; max-height: 100%; } .tether-element.tether-theme-arrows .tether-content { border-radius: 5px; position: relative; font-family: inherit; background: #fff; color: inherit; padding: 1em; font-size: 1.1em; line-height: 1.5em; -webkit-transform: translateZ(0); transform: translateZ(0); -webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); } .tether-element.tether-theme-arrows .tether-content:before { content: ""; display: block; position: absolute; width: 0; height: 0; border-color: transparent; border-width: 16px; border-style: solid; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-center .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-center .tether-content:before { top: 100%; left: 50%; margin-left: -16px; border-top-color: #fff; border-bottom: 0; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-center .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-center .tether-content:before { bottom: 100%; left: 50%; margin-left: -16px; border-bottom-color: #fff; border-top: 0; } .tether-element.tether-theme-arrows.tether-element-attached-right.tether-element-attached-middle .tether-content { margin-right: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-right.tether-element-attached-middle .tether-content:before { left: 100%; top: 50%; margin-top: -16px; border-left-color: #fff; border-right: 0; } .tether-element.tether-theme-arrows.tether-element-attached-left.tether-element-attached-middle .tether-content { margin-left: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-left.tether-element-attached-middle .tether-content:before { right: 100%; top: 50%; margin-top: -16px; border-right-color: #fff; border-left: 0; } .tether-element.tether-theme-arrows.tether-element-attached-left.tether-target-attached-center .tether-content { left: -32px; } .tether-element.tether-theme-arrows.tether-element-attached-right.tether-target-attached-center .tether-content { left: 32px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-middle .tether-content:before { bottom: 100%; left: 16px; border-bottom-color: #fff; border-top: 0; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-middle .tether-content:before { bottom: 100%; right: 16px; border-bottom-color: #fff; border-top: 0; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-middle .tether-content:before { top: 100%; left: 16px; border-top-color: #fff; border-bottom: 0; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-middle .tether-content:before { top: 100%; right: 16px; border-top-color: #fff; border-bottom: 0; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .tether-content:before { bottom: 100%; left: 16px; border-bottom-color: #fff; border-top: 0; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content { margin-top: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .tether-content:before { bottom: 100%; right: 16px; border-bottom-color: #fff; border-top: 0; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .tether-content:before { top: 100%; left: 16px; border-top-color: #fff; border-bottom: 0; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content { margin-bottom: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .tether-content:before { top: 100%; right: 16px; border-top-color: #fff; border-bottom: 0; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content { margin-right: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .tether-content:before { top: 16px; left: 100%; border-left-color: #fff; border-right: 0; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content { margin-left: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content:before { top: 16px; right: 100%; border-right-color: #fff; border-left: 0; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content { margin-right: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .tether-content:before { bottom: 16px; left: 100%; border-left-color: #fff; border-right: 0; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content { margin-left: 16px; } .tether-element.tether-theme-arrows.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .tether-content:before { bottom: 16px; right: 100%; border-right-color: #fff; border-left: 0; } dist/js/tether.js 0000644 00000156554 15073227372 0010004 0 ustar 00 /*! tether 1.4.7 */ (function(root, factory) { if (typeof define === 'function' && define.amd) { define([], factory); } else if (typeof exports === 'object') { module.exports = factory(); } else { root.Tether = factory(); } }(this, function() { 'use strict'; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var TetherBase = undefined; if (typeof TetherBase === 'undefined') { TetherBase = { modules: [] }; } var zeroElement = null; // Same as native getBoundingClientRect, except it takes into account parent <frame> offsets // if the element lies within a nested document (<frame> or <iframe>-like). function getActualBoundingClientRect(node) { var boundingRect = node.getBoundingClientRect(); // The original object returned by getBoundingClientRect is immutable, so we clone it // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9 var rect = {}; for (var k in boundingRect) { rect[k] = boundingRect[k]; } try { if (node.ownerDocument !== document) { var _frameElement = node.ownerDocument.defaultView.frameElement; if (_frameElement) { var frameRect = getActualBoundingClientRect(_frameElement); rect.top += frameRect.top; rect.bottom += frameRect.top; rect.left += frameRect.left; rect.right += frameRect.left; } } } catch (err) { // Ignore "Access is denied" in IE11/Edge } return rect; } function getScrollParents(el) { // In firefox if the el is inside an iframe with display: none; window.getComputedStyle() will return null; // https://bugzilla.mozilla.org/show_bug.cgi?id=548397 var computedStyle = getComputedStyle(el) || {}; var position = computedStyle.position; var parents = []; if (position === 'fixed') { return [el]; } var parent = el; while ((parent = parent.parentNode) && parent && parent.nodeType === 1) { var style = undefined; try { style = getComputedStyle(parent); } catch (err) {} if (typeof style === 'undefined' || style === null) { parents.push(parent); return parents; } var _style = style; var overflow = _style.overflow; var overflowX = _style.overflowX; var overflowY = _style.overflowY; if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { if (position !== 'absolute' || ['relative', 'absolute', 'fixed'].indexOf(style.position) >= 0) { parents.push(parent); } } } parents.push(el.ownerDocument.body); // If the node is within a frame, account for the parent window scroll if (el.ownerDocument !== document) { parents.push(el.ownerDocument.defaultView); } return parents; } var uniqueId = (function () { var id = 0; return function () { return ++id; }; })(); var zeroPosCache = {}; var getOrigin = function getOrigin() { // getBoundingClientRect is unfortunately too accurate. It introduces a pixel or two of // jitter as the user scrolls that messes with our ability to detect if two positions // are equivilant or not. We place an element at the top left of the page that will // get the same jitter, so we can cancel the two out. var node = zeroElement; if (!node || !document.body.contains(node)) { node = document.createElement('div'); node.setAttribute('data-tether-id', uniqueId()); extend(node.style, { top: 0, left: 0, position: 'absolute' }); document.body.appendChild(node); zeroElement = node; } var id = node.getAttribute('data-tether-id'); if (typeof zeroPosCache[id] === 'undefined') { zeroPosCache[id] = getActualBoundingClientRect(node); // Clear the cache when this position call is done defer(function () { delete zeroPosCache[id]; }); } return zeroPosCache[id]; }; function removeUtilElements() { if (zeroElement) { document.body.removeChild(zeroElement); } zeroElement = null; }; function getBounds(el) { var doc = undefined; if (el === document) { doc = document; el = document.documentElement; } else { doc = el.ownerDocument; } var docEl = doc.documentElement; var box = getActualBoundingClientRect(el); var origin = getOrigin(); box.top -= origin.top; box.left -= origin.left; if (typeof box.width === 'undefined') { box.width = document.body.scrollWidth - box.left - box.right; } if (typeof box.height === 'undefined') { box.height = document.body.scrollHeight - box.top - box.bottom; } box.top = box.top - docEl.clientTop; box.left = box.left - docEl.clientLeft; box.right = doc.body.clientWidth - box.width - box.left; box.bottom = doc.body.clientHeight - box.height - box.top; return box; } function getOffsetParent(el) { return el.offsetParent || document.documentElement; } var _scrollBarSize = null; function getScrollBarSize() { if (_scrollBarSize) { return _scrollBarSize; } var inner = document.createElement('div'); inner.style.width = '100%'; inner.style.height = '200px'; var outer = document.createElement('div'); extend(outer.style, { position: 'absolute', top: 0, left: 0, pointerEvents: 'none', visibility: 'hidden', width: '200px', height: '150px', overflow: 'hidden' }); outer.appendChild(inner); document.body.appendChild(outer); var widthContained = inner.offsetWidth; outer.style.overflow = 'scroll'; var widthScroll = inner.offsetWidth; if (widthContained === widthScroll) { widthScroll = outer.clientWidth; } document.body.removeChild(outer); var width = widthContained - widthScroll; _scrollBarSize = { width: width, height: width }; return _scrollBarSize; } function extend() { var out = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var args = []; Array.prototype.push.apply(args, arguments); args.slice(1).forEach(function (obj) { if (obj) { for (var key in obj) { if (({}).hasOwnProperty.call(obj, key)) { out[key] = obj[key]; } } } }); return out; } function removeClass(el, name) { if (typeof el.classList !== 'undefined') { name.split(' ').forEach(function (cls) { if (cls.trim()) { el.classList.remove(cls); } }); } else { var regex = new RegExp('(^| )' + name.split(' ').join('|') + '( |$)', 'gi'); var className = getClassName(el).replace(regex, ' '); setClassName(el, className); } } function addClass(el, name) { if (typeof el.classList !== 'undefined') { name.split(' ').forEach(function (cls) { if (cls.trim()) { el.classList.add(cls); } }); } else { removeClass(el, name); var cls = getClassName(el) + (' ' + name); setClassName(el, cls); } } function hasClass(el, name) { if (typeof el.classList !== 'undefined') { return el.classList.contains(name); } var className = getClassName(el); return new RegExp('(^| )' + name + '( |$)', 'gi').test(className); } function getClassName(el) { // Can't use just SVGAnimatedString here since nodes within a Frame in IE have // completely separately SVGAnimatedString base classes if (el.className instanceof el.ownerDocument.defaultView.SVGAnimatedString) { return el.className.baseVal; } return el.className; } function setClassName(el, className) { el.setAttribute('class', className); } function updateClasses(el, add, all) { // Of the set of 'all' classes, we need the 'add' classes, and only the // 'add' classes to be set. all.forEach(function (cls) { if (add.indexOf(cls) === -1 && hasClass(el, cls)) { removeClass(el, cls); } }); add.forEach(function (cls) { if (!hasClass(el, cls)) { addClass(el, cls); } }); } var deferred = []; var defer = function defer(fn) { deferred.push(fn); }; var flush = function flush() { var fn = undefined; while (fn = deferred.pop()) { fn(); } }; var Evented = (function () { function Evented() { _classCallCheck(this, Evented); } _createClass(Evented, [{ key: 'on', value: function on(event, handler, ctx) { var once = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; if (typeof this.bindings === 'undefined') { this.bindings = {}; } if (typeof this.bindings[event] === 'undefined') { this.bindings[event] = []; } this.bindings[event].push({ handler: handler, ctx: ctx, once: once }); } }, { key: 'once', value: function once(event, handler, ctx) { this.on(event, handler, ctx, true); } }, { key: 'off', value: function off(event, handler) { if (typeof this.bindings === 'undefined' || typeof this.bindings[event] === 'undefined') { return; } if (typeof handler === 'undefined') { delete this.bindings[event]; } else { var i = 0; while (i < this.bindings[event].length) { if (this.bindings[event][i].handler === handler) { this.bindings[event].splice(i, 1); } else { ++i; } } } } }, { key: 'trigger', value: function trigger(event) { if (typeof this.bindings !== 'undefined' && this.bindings[event]) { var i = 0; for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } while (i < this.bindings[event].length) { var _bindings$event$i = this.bindings[event][i]; var handler = _bindings$event$i.handler; var ctx = _bindings$event$i.ctx; var once = _bindings$event$i.once; var context = ctx; if (typeof context === 'undefined') { context = this; } handler.apply(context, args); if (once) { this.bindings[event].splice(i, 1); } else { ++i; } } } } }]); return Evented; })(); TetherBase.Utils = { getActualBoundingClientRect: getActualBoundingClientRect, getScrollParents: getScrollParents, getBounds: getBounds, getOffsetParent: getOffsetParent, extend: extend, addClass: addClass, removeClass: removeClass, hasClass: hasClass, updateClasses: updateClasses, defer: defer, flush: flush, uniqueId: uniqueId, Evented: Evented, getScrollBarSize: getScrollBarSize, removeUtilElements: removeUtilElements }; /* globals TetherBase, performance */ 'use strict'; var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x6, _x7, _x8) { var _again = true; _function: while (_again) { var object = _x6, property = _x7, receiver = _x8; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x6 = parent; _x7 = property; _x8 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } if (typeof TetherBase === 'undefined') { throw new Error('You must include the utils.js file before tether.js'); } var _TetherBase$Utils = TetherBase.Utils; var getScrollParents = _TetherBase$Utils.getScrollParents; var getBounds = _TetherBase$Utils.getBounds; var getOffsetParent = _TetherBase$Utils.getOffsetParent; var extend = _TetherBase$Utils.extend; var addClass = _TetherBase$Utils.addClass; var removeClass = _TetherBase$Utils.removeClass; var updateClasses = _TetherBase$Utils.updateClasses; var defer = _TetherBase$Utils.defer; var flush = _TetherBase$Utils.flush; var getScrollBarSize = _TetherBase$Utils.getScrollBarSize; var removeUtilElements = _TetherBase$Utils.removeUtilElements; function within(a, b) { var diff = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2]; return a + diff >= b && b >= a - diff; } var transformKey = (function () { if (typeof document === 'undefined') { return ''; } var el = document.createElement('div'); var transforms = ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform']; for (var i = 0; i < transforms.length; ++i) { var key = transforms[i]; if (el.style[key] !== undefined) { return key; } } })(); var tethers = []; var position = function position() { tethers.forEach(function (tether) { tether.position(false); }); flush(); }; function now() { if (typeof performance === 'object' && typeof performance.now === 'function') { return performance.now(); } return +new Date(); } (function () { var lastCall = null; var lastDuration = null; var pendingTimeout = null; var tick = function tick() { if (typeof lastDuration !== 'undefined' && lastDuration > 16) { // We voluntarily throttle ourselves if we can't manage 60fps lastDuration = Math.min(lastDuration - 16, 250); // Just in case this is the last event, remember to position just once more pendingTimeout = setTimeout(tick, 250); return; } if (typeof lastCall !== 'undefined' && now() - lastCall < 10) { // Some browsers call events a little too frequently, refuse to run more than is reasonable return; } if (pendingTimeout != null) { clearTimeout(pendingTimeout); pendingTimeout = null; } lastCall = now(); position(); lastDuration = now() - lastCall; }; if (typeof window !== 'undefined' && typeof window.addEventListener !== 'undefined') { ['resize', 'scroll', 'touchmove'].forEach(function (event) { window.addEventListener(event, tick); }); } })(); var MIRROR_LR = { center: 'center', left: 'right', right: 'left' }; var MIRROR_TB = { middle: 'middle', top: 'bottom', bottom: 'top' }; var OFFSET_MAP = { top: 0, left: 0, middle: '50%', center: '50%', bottom: '100%', right: '100%' }; var autoToFixedAttachment = function autoToFixedAttachment(attachment, relativeToAttachment) { var left = attachment.left; var top = attachment.top; if (left === 'auto') { left = MIRROR_LR[relativeToAttachment.left]; } if (top === 'auto') { top = MIRROR_TB[relativeToAttachment.top]; } return { left: left, top: top }; }; var attachmentToOffset = function attachmentToOffset(attachment) { var left = attachment.left; var top = attachment.top; if (typeof OFFSET_MAP[attachment.left] !== 'undefined') { left = OFFSET_MAP[attachment.left]; } if (typeof OFFSET_MAP[attachment.top] !== 'undefined') { top = OFFSET_MAP[attachment.top]; } return { left: left, top: top }; }; function addOffset() { var out = { top: 0, left: 0 }; for (var _len = arguments.length, offsets = Array(_len), _key = 0; _key < _len; _key++) { offsets[_key] = arguments[_key]; } offsets.forEach(function (_ref) { var top = _ref.top; var left = _ref.left; if (typeof top === 'string') { top = parseFloat(top, 10); } if (typeof left === 'string') { left = parseFloat(left, 10); } out.top += top; out.left += left; }); return out; } function offsetToPx(offset, size) { if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) { offset.left = parseFloat(offset.left, 10) / 100 * size.width; } if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) { offset.top = parseFloat(offset.top, 10) / 100 * size.height; } return offset; } var parseOffset = function parseOffset(value) { var _value$split = value.split(' '); var _value$split2 = _slicedToArray(_value$split, 2); var top = _value$split2[0]; var left = _value$split2[1]; return { top: top, left: left }; }; var parseAttachment = parseOffset; var TetherClass = (function (_Evented) { _inherits(TetherClass, _Evented); function TetherClass(options) { var _this = this; _classCallCheck(this, TetherClass); _get(Object.getPrototypeOf(TetherClass.prototype), 'constructor', this).call(this); this.position = this.position.bind(this); tethers.push(this); this.history = []; this.setOptions(options, false); TetherBase.modules.forEach(function (module) { if (typeof module.initialize !== 'undefined') { module.initialize.call(_this); } }); this.position(); } _createClass(TetherClass, [{ key: 'getClass', value: function getClass() { var key = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; var classes = this.options.classes; if (typeof classes !== 'undefined' && classes[key]) { return this.options.classes[key]; } else if (this.options.classPrefix) { return this.options.classPrefix + '-' + key; } else { return key; } } }, { key: 'setOptions', value: function setOptions(options) { var _this2 = this; var pos = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; var defaults = { offset: '0 0', targetOffset: '0 0', targetAttachment: 'auto auto', classPrefix: 'tether' }; this.options = extend(defaults, options); var _options = this.options; var element = _options.element; var target = _options.target; var targetModifier = _options.targetModifier; this.element = element; this.target = target; this.targetModifier = targetModifier; if (this.target === 'viewport') { this.target = document.body; this.targetModifier = 'visible'; } else if (this.target === 'scroll-handle') { this.target = document.body; this.targetModifier = 'scroll-handle'; } ['element', 'target'].forEach(function (key) { if (typeof _this2[key] === 'undefined') { throw new Error('Tether Error: Both element and target must be defined'); } if (typeof _this2[key].jquery !== 'undefined') { _this2[key] = _this2[key][0]; } else if (typeof _this2[key] === 'string') { _this2[key] = document.querySelector(_this2[key]); } }); addClass(this.element, this.getClass('element')); if (!(this.options.addTargetClasses === false)) { addClass(this.target, this.getClass('target')); } if (!this.options.attachment) { throw new Error('Tether Error: You must provide an attachment'); } this.targetAttachment = parseAttachment(this.options.targetAttachment); this.attachment = parseAttachment(this.options.attachment); this.offset = parseOffset(this.options.offset); this.targetOffset = parseOffset(this.options.targetOffset); if (typeof this.scrollParents !== 'undefined') { this.disable(); } if (this.targetModifier === 'scroll-handle') { this.scrollParents = [this.target]; } else { this.scrollParents = getScrollParents(this.target); } if (!(this.options.enabled === false)) { this.enable(pos); } } }, { key: 'getTargetBounds', value: function getTargetBounds() { if (typeof this.targetModifier !== 'undefined') { if (this.targetModifier === 'visible') { if (this.target === document.body) { return { top: pageYOffset, left: pageXOffset, height: innerHeight, width: innerWidth }; } else { var bounds = getBounds(this.target); var out = { height: bounds.height, width: bounds.width, top: bounds.top, left: bounds.left }; out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top)); out.height = Math.min(out.height, bounds.height - (bounds.top + bounds.height - (pageYOffset + innerHeight))); out.height = Math.min(innerHeight, out.height); out.height -= 2; out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left)); out.width = Math.min(out.width, bounds.width - (bounds.left + bounds.width - (pageXOffset + innerWidth))); out.width = Math.min(innerWidth, out.width); out.width -= 2; if (out.top < pageYOffset) { out.top = pageYOffset; } if (out.left < pageXOffset) { out.left = pageXOffset; } return out; } } else if (this.targetModifier === 'scroll-handle') { var bounds = undefined; var target = this.target; if (target === document.body) { target = document.documentElement; bounds = { left: pageXOffset, top: pageYOffset, height: innerHeight, width: innerWidth }; } else { bounds = getBounds(target); } var style = getComputedStyle(target); var hasBottomScroll = target.scrollWidth > target.clientWidth || [style.overflow, style.overflowX].indexOf('scroll') >= 0 || this.target !== document.body; var scrollBottom = 0; if (hasBottomScroll) { scrollBottom = 15; } var height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom; var out = { width: 15, height: height * 0.975 * (height / target.scrollHeight), left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15 }; var fitAdj = 0; if (height < 408 && this.target === document.body) { fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58; } if (this.target !== document.body) { out.height = Math.max(out.height, 24); } var scrollPercentage = this.target.scrollTop / (target.scrollHeight - height); out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth); if (this.target === document.body) { out.height = Math.max(out.height, 24); } return out; } } else { return getBounds(this.target); } } }, { key: 'clearCache', value: function clearCache() { this._cache = {}; } }, { key: 'cache', value: function cache(k, getter) { // More than one module will often need the same DOM info, so // we keep a cache which is cleared on each position call if (typeof this._cache === 'undefined') { this._cache = {}; } if (typeof this._cache[k] === 'undefined') { this._cache[k] = getter.call(this); } return this._cache[k]; } }, { key: 'enable', value: function enable() { var _this3 = this; var pos = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; if (!(this.options.addTargetClasses === false)) { addClass(this.target, this.getClass('enabled')); } addClass(this.element, this.getClass('enabled')); this.enabled = true; this.scrollParents.forEach(function (parent) { if (parent !== _this3.target.ownerDocument) { parent.addEventListener('scroll', _this3.position); } }); if (pos) { this.position(); } } }, { key: 'disable', value: function disable() { var _this4 = this; removeClass(this.target, this.getClass('enabled')); removeClass(this.element, this.getClass('enabled')); this.enabled = false; if (typeof this.scrollParents !== 'undefined') { this.scrollParents.forEach(function (parent) { parent.removeEventListener('scroll', _this4.position); }); } } }, { key: 'destroy', value: function destroy() { var _this5 = this; this.disable(); tethers.forEach(function (tether, i) { if (tether === _this5) { tethers.splice(i, 1); } }); // Remove any elements we were using for convenience from the DOM if (tethers.length === 0) { removeUtilElements(); } } }, { key: 'updateAttachClasses', value: function updateAttachClasses(elementAttach, targetAttach) { var _this6 = this; elementAttach = elementAttach || this.attachment; targetAttach = targetAttach || this.targetAttachment; var sides = ['left', 'top', 'bottom', 'right', 'middle', 'center']; if (typeof this._addAttachClasses !== 'undefined' && this._addAttachClasses.length) { // updateAttachClasses can be called more than once in a position call, so // we need to clean up after ourselves such that when the last defer gets // ran it doesn't add any extra classes from previous calls. this._addAttachClasses.splice(0, this._addAttachClasses.length); } if (typeof this._addAttachClasses === 'undefined') { this._addAttachClasses = []; } var add = this._addAttachClasses; if (elementAttach.top) { add.push(this.getClass('element-attached') + '-' + elementAttach.top); } if (elementAttach.left) { add.push(this.getClass('element-attached') + '-' + elementAttach.left); } if (targetAttach.top) { add.push(this.getClass('target-attached') + '-' + targetAttach.top); } if (targetAttach.left) { add.push(this.getClass('target-attached') + '-' + targetAttach.left); } var all = []; sides.forEach(function (side) { all.push(_this6.getClass('element-attached') + '-' + side); all.push(_this6.getClass('target-attached') + '-' + side); }); defer(function () { if (!(typeof _this6._addAttachClasses !== 'undefined')) { return; } updateClasses(_this6.element, _this6._addAttachClasses, all); if (!(_this6.options.addTargetClasses === false)) { updateClasses(_this6.target, _this6._addAttachClasses, all); } delete _this6._addAttachClasses; }); } }, { key: 'position', value: function position() { var _this7 = this; var flushChanges = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; // flushChanges commits the changes immediately, leave true unless you are positioning multiple // tethers (in which case call Tether.Utils.flush yourself when you're done) if (!this.enabled) { return; } this.clearCache(); // Turn 'auto' attachments into the appropriate corner or edge var targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment); this.updateAttachClasses(this.attachment, targetAttachment); var elementPos = this.cache('element-bounds', function () { return getBounds(_this7.element); }); var width = elementPos.width; var height = elementPos.height; if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') { var _lastSize = this.lastSize; // We cache the height and width to make it possible to position elements that are // getting hidden. width = _lastSize.width; height = _lastSize.height; } else { this.lastSize = { width: width, height: height }; } var targetPos = this.cache('target-bounds', function () { return _this7.getTargetBounds(); }); var targetSize = targetPos; // Get an actual px offset from the attachment var offset = offsetToPx(attachmentToOffset(this.attachment), { width: width, height: height }); var targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize); var manualOffset = offsetToPx(this.offset, { width: width, height: height }); var manualTargetOffset = offsetToPx(this.targetOffset, targetSize); // Add the manually provided offset offset = addOffset(offset, manualOffset); targetOffset = addOffset(targetOffset, manualTargetOffset); // It's now our goal to make (element position + offset) == (target position + target offset) var left = targetPos.left + targetOffset.left - offset.left; var top = targetPos.top + targetOffset.top - offset.top; for (var i = 0; i < TetherBase.modules.length; ++i) { var _module2 = TetherBase.modules[i]; var ret = _module2.position.call(this, { left: left, top: top, targetAttachment: targetAttachment, targetPos: targetPos, elementPos: elementPos, offset: offset, targetOffset: targetOffset, manualOffset: manualOffset, manualTargetOffset: manualTargetOffset, scrollbarSize: scrollbarSize, attachment: this.attachment }); if (ret === false) { return false; } else if (typeof ret === 'undefined' || typeof ret !== 'object') { continue; } else { top = ret.top; left = ret.left; } } // We describe the position three different ways to give the optimizer // a chance to decide the best possible way to position the element // with the fewest repaints. var next = { // It's position relative to the page (absolute positioning when // the element is a child of the body) page: { top: top, left: left }, // It's position relative to the viewport (fixed positioning) viewport: { top: top - pageYOffset, bottom: pageYOffset - top - height + innerHeight, left: left - pageXOffset, right: pageXOffset - left - width + innerWidth } }; var doc = this.target.ownerDocument; var win = doc.defaultView; var scrollbarSize = undefined; if (win.innerHeight > doc.documentElement.clientHeight) { scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); next.viewport.bottom -= scrollbarSize.height; } if (win.innerWidth > doc.documentElement.clientWidth) { scrollbarSize = this.cache('scrollbar-size', getScrollBarSize); next.viewport.right -= scrollbarSize.width; } if (['', 'static'].indexOf(doc.body.style.position) === -1 || ['', 'static'].indexOf(doc.body.parentElement.style.position) === -1) { // Absolute positioning in the body will be relative to the page, not the 'initial containing block' next.page.bottom = doc.body.scrollHeight - top - height; next.page.right = doc.body.scrollWidth - left - width; } if (typeof this.options.optimizations !== 'undefined' && this.options.optimizations.moveElement !== false && !(typeof this.targetModifier !== 'undefined')) { (function () { var offsetParent = _this7.cache('target-offsetparent', function () { return getOffsetParent(_this7.target); }); var offsetPosition = _this7.cache('target-offsetparent-bounds', function () { return getBounds(offsetParent); }); var offsetParentStyle = getComputedStyle(offsetParent); var offsetParentSize = offsetPosition; var offsetBorder = {}; ['Top', 'Left', 'Bottom', 'Right'].forEach(function (side) { offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle['border' + side + 'Width']); }); offsetPosition.right = doc.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right; offsetPosition.bottom = doc.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom; if (next.page.top >= offsetPosition.top + offsetBorder.top && next.page.bottom >= offsetPosition.bottom) { if (next.page.left >= offsetPosition.left + offsetBorder.left && next.page.right >= offsetPosition.right) { // We're within the visible part of the target's scroll parent var scrollTop = offsetParent.scrollTop; var scrollLeft = offsetParent.scrollLeft; // It's position relative to the target's offset parent (absolute positioning when // the element is moved to be a child of the target's offset parent). next.offset = { top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top, left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left }; } } })(); } // We could also travel up the DOM and try each containing context, rather than only // looking at the body, but we're gonna get diminishing returns. this.move(next); this.history.unshift(next); if (this.history.length > 3) { this.history.pop(); } if (flushChanges) { flush(); } return true; } // THE ISSUE }, { key: 'move', value: function move(pos) { var _this8 = this; if (!(typeof this.element.parentNode !== 'undefined')) { return; } var same = {}; for (var type in pos) { same[type] = {}; for (var key in pos[type]) { var found = false; for (var i = 0; i < this.history.length; ++i) { var point = this.history[i]; if (typeof point[type] !== 'undefined' && !within(point[type][key], pos[type][key])) { found = true; break; } } if (!found) { same[type][key] = true; } } } var css = { top: '', left: '', right: '', bottom: '' }; var transcribe = function transcribe(_same, _pos) { var hasOptimizations = typeof _this8.options.optimizations !== 'undefined'; var gpu = hasOptimizations ? _this8.options.optimizations.gpu : null; if (gpu !== false) { var yPos = undefined, xPos = undefined; if (_same.top) { css.top = 0; yPos = _pos.top; } else { css.bottom = 0; yPos = -_pos.bottom; } if (_same.left) { css.left = 0; xPos = _pos.left; } else { css.right = 0; xPos = -_pos.right; } if (typeof window.devicePixelRatio === 'number' && devicePixelRatio % 1 === 0) { xPos = Math.round(xPos * devicePixelRatio) / devicePixelRatio; yPos = Math.round(yPos * devicePixelRatio) / devicePixelRatio; } css[transformKey] = 'translateX(' + xPos + 'px) translateY(' + yPos + 'px)'; if (transformKey !== 'msTransform') { // The Z transform will keep this in the GPU (faster, and prevents artifacts), // but IE9 doesn't support 3d transforms and will choke. css[transformKey] += " translateZ(0)"; } } else { if (_same.top) { css.top = _pos.top + 'px'; } else { css.bottom = _pos.bottom + 'px'; } if (_same.left) { css.left = _pos.left + 'px'; } else { css.right = _pos.right + 'px'; } } }; var moved = false; if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) { css.position = 'absolute'; transcribe(same.page, pos.page); } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) { css.position = 'fixed'; transcribe(same.viewport, pos.viewport); } else if (typeof same.offset !== 'undefined' && same.offset.top && same.offset.left) { (function () { css.position = 'absolute'; var offsetParent = _this8.cache('target-offsetparent', function () { return getOffsetParent(_this8.target); }); if (getOffsetParent(_this8.element) !== offsetParent) { defer(function () { _this8.element.parentNode.removeChild(_this8.element); offsetParent.appendChild(_this8.element); }); } transcribe(same.offset, pos.offset); moved = true; })(); } else { css.position = 'absolute'; transcribe({ top: true, left: true }, pos.page); } if (!moved) { if (this.options.bodyElement) { if (this.element.parentNode !== this.options.bodyElement) { this.options.bodyElement.appendChild(this.element); } } else { var isFullscreenElement = function isFullscreenElement(e) { var d = e.ownerDocument; var fe = d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement || d.msFullscreenElement; return fe === e; }; var offsetParentIsBody = true; var currentNode = this.element.parentNode; while (currentNode && currentNode.nodeType === 1 && currentNode.tagName !== 'BODY' && !isFullscreenElement(currentNode)) { if (getComputedStyle(currentNode).position !== 'static') { offsetParentIsBody = false; break; } currentNode = currentNode.parentNode; } if (!offsetParentIsBody) { this.element.parentNode.removeChild(this.element); this.element.ownerDocument.body.appendChild(this.element); } } } // Any css change will trigger a repaint, so let's avoid one if nothing changed var writeCSS = {}; var write = false; for (var key in css) { var val = css[key]; var elVal = this.element.style[key]; if (elVal !== val) { write = true; writeCSS[key] = val; } } if (write) { defer(function () { extend(_this8.element.style, writeCSS); _this8.trigger('repositioned'); }); } } }]); return TetherClass; })(Evented); TetherClass.modules = []; TetherBase.position = position; var Tether = extend(TetherClass, TetherBase); /* globals TetherBase */ 'use strict'; var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); var _TetherBase$Utils = TetherBase.Utils; var getBounds = _TetherBase$Utils.getBounds; var extend = _TetherBase$Utils.extend; var updateClasses = _TetherBase$Utils.updateClasses; var defer = _TetherBase$Utils.defer; var BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom']; function getBoundingRect(tether, to) { if (to === 'scrollParent') { to = tether.scrollParents[0]; } else if (to === 'window') { to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset]; } if (to === document) { to = to.documentElement; } if (typeof to.nodeType !== 'undefined') { (function () { var node = to; var size = getBounds(to); var pos = size; var style = getComputedStyle(to); to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top]; // Account any parent Frames scroll offset if (node.ownerDocument !== document) { var win = node.ownerDocument.defaultView; to[0] += win.pageXOffset; to[1] += win.pageYOffset; to[2] += win.pageXOffset; to[3] += win.pageYOffset; } BOUNDS_FORMAT.forEach(function (side, i) { side = side[0].toUpperCase() + side.substr(1); if (side === 'Top' || side === 'Left') { to[i] += parseFloat(style['border' + side + 'Width']); } else { to[i] -= parseFloat(style['border' + side + 'Width']); } }); })(); } return to; } TetherBase.modules.push({ position: function position(_ref) { var _this = this; var top = _ref.top; var left = _ref.left; var targetAttachment = _ref.targetAttachment; if (!this.options.constraints) { return true; } var _cache = this.cache('element-bounds', function () { return getBounds(_this.element); }); var height = _cache.height; var width = _cache.width; if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') { var _lastSize = this.lastSize; // Handle the item getting hidden as a result of our positioning without glitching // the classes in and out width = _lastSize.width; height = _lastSize.height; } var targetSize = this.cache('target-bounds', function () { return _this.getTargetBounds(); }); var targetHeight = targetSize.height; var targetWidth = targetSize.width; var allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')]; this.options.constraints.forEach(function (constraint) { var outOfBoundsClass = constraint.outOfBoundsClass; var pinnedClass = constraint.pinnedClass; if (outOfBoundsClass) { allClasses.push(outOfBoundsClass); } if (pinnedClass) { allClasses.push(pinnedClass); } }); allClasses.forEach(function (cls) { ['left', 'top', 'right', 'bottom'].forEach(function (side) { allClasses.push(cls + '-' + side); }); }); var addClasses = []; var tAttachment = extend({}, targetAttachment); var eAttachment = extend({}, this.attachment); this.options.constraints.forEach(function (constraint) { var to = constraint.to; var attachment = constraint.attachment; var pin = constraint.pin; if (typeof attachment === 'undefined') { attachment = ''; } var changeAttachX = undefined, changeAttachY = undefined; if (attachment.indexOf(' ') >= 0) { var _attachment$split = attachment.split(' '); var _attachment$split2 = _slicedToArray(_attachment$split, 2); changeAttachY = _attachment$split2[0]; changeAttachX = _attachment$split2[1]; } else { changeAttachX = changeAttachY = attachment; } var bounds = getBoundingRect(_this, to); if (changeAttachY === 'target' || changeAttachY === 'both') { if (top < bounds[1] && tAttachment.top === 'top') { top += targetHeight; tAttachment.top = 'bottom'; } if (top + height > bounds[3] && tAttachment.top === 'bottom') { top -= targetHeight; tAttachment.top = 'top'; } } if (changeAttachY === 'together') { if (tAttachment.top === 'top') { if (eAttachment.top === 'bottom' && top < bounds[1]) { top += targetHeight; tAttachment.top = 'bottom'; top += height; eAttachment.top = 'top'; } else if (eAttachment.top === 'top' && top + height > bounds[3] && top - (height - targetHeight) >= bounds[1]) { top -= height - targetHeight; tAttachment.top = 'bottom'; eAttachment.top = 'bottom'; } } if (tAttachment.top === 'bottom') { if (eAttachment.top === 'top' && top + height > bounds[3]) { top -= targetHeight; tAttachment.top = 'top'; top -= height; eAttachment.top = 'bottom'; } else if (eAttachment.top === 'bottom' && top < bounds[1] && top + (height * 2 - targetHeight) <= bounds[3]) { top += height - targetHeight; tAttachment.top = 'top'; eAttachment.top = 'top'; } } if (tAttachment.top === 'middle') { if (top + height > bounds[3] && eAttachment.top === 'top') { top -= height; eAttachment.top = 'bottom'; } else if (top < bounds[1] && eAttachment.top === 'bottom') { top += height; eAttachment.top = 'top'; } } } if (changeAttachX === 'target' || changeAttachX === 'both') { if (left < bounds[0] && tAttachment.left === 'left') { left += targetWidth; tAttachment.left = 'right'; } if (left + width > bounds[2] && tAttachment.left === 'right') { left -= targetWidth; tAttachment.left = 'left'; } } if (changeAttachX === 'together') { if (left < bounds[0] && tAttachment.left === 'left') { if (eAttachment.left === 'right') { left += targetWidth; tAttachment.left = 'right'; left += width; eAttachment.left = 'left'; } else if (eAttachment.left === 'left') { left += targetWidth; tAttachment.left = 'right'; left -= width; eAttachment.left = 'right'; } } else if (left + width > bounds[2] && tAttachment.left === 'right') { if (eAttachment.left === 'left') { left -= targetWidth; tAttachment.left = 'left'; left -= width; eAttachment.left = 'right'; } else if (eAttachment.left === 'right') { left -= targetWidth; tAttachment.left = 'left'; left += width; eAttachment.left = 'left'; } } else if (tAttachment.left === 'center') { if (left + width > bounds[2] && eAttachment.left === 'left') { left -= width; eAttachment.left = 'right'; } else if (left < bounds[0] && eAttachment.left === 'right') { left += width; eAttachment.left = 'left'; } } } if (changeAttachY === 'element' || changeAttachY === 'both') { if (top < bounds[1] && eAttachment.top === 'bottom') { top += height; eAttachment.top = 'top'; } if (top + height > bounds[3] && eAttachment.top === 'top') { top -= height; eAttachment.top = 'bottom'; } } if (changeAttachX === 'element' || changeAttachX === 'both') { if (left < bounds[0]) { if (eAttachment.left === 'right') { left += width; eAttachment.left = 'left'; } else if (eAttachment.left === 'center') { left += width / 2; eAttachment.left = 'left'; } } if (left + width > bounds[2]) { if (eAttachment.left === 'left') { left -= width; eAttachment.left = 'right'; } else if (eAttachment.left === 'center') { left -= width / 2; eAttachment.left = 'right'; } } } if (typeof pin === 'string') { pin = pin.split(',').map(function (p) { return p.trim(); }); } else if (pin === true) { pin = ['top', 'left', 'right', 'bottom']; } pin = pin || []; var pinned = []; var oob = []; if (top < bounds[1]) { if (pin.indexOf('top') >= 0) { top = bounds[1]; pinned.push('top'); } else { oob.push('top'); } } if (top + height > bounds[3]) { if (pin.indexOf('bottom') >= 0) { top = bounds[3] - height; pinned.push('bottom'); } else { oob.push('bottom'); } } if (left < bounds[0]) { if (pin.indexOf('left') >= 0) { left = bounds[0]; pinned.push('left'); } else { oob.push('left'); } } if (left + width > bounds[2]) { if (pin.indexOf('right') >= 0) { left = bounds[2] - width; pinned.push('right'); } else { oob.push('right'); } } if (pinned.length) { (function () { var pinnedClass = undefined; if (typeof _this.options.pinnedClass !== 'undefined') { pinnedClass = _this.options.pinnedClass; } else { pinnedClass = _this.getClass('pinned'); } addClasses.push(pinnedClass); pinned.forEach(function (side) { addClasses.push(pinnedClass + '-' + side); }); })(); } if (oob.length) { (function () { var oobClass = undefined; if (typeof _this.options.outOfBoundsClass !== 'undefined') { oobClass = _this.options.outOfBoundsClass; } else { oobClass = _this.getClass('out-of-bounds'); } addClasses.push(oobClass); oob.forEach(function (side) { addClasses.push(oobClass + '-' + side); }); })(); } if (pinned.indexOf('left') >= 0 || pinned.indexOf('right') >= 0) { eAttachment.left = tAttachment.left = false; } if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) { eAttachment.top = tAttachment.top = false; } if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== _this.attachment.top || eAttachment.left !== _this.attachment.left) { _this.updateAttachClasses(eAttachment, tAttachment); _this.trigger('update', { attachment: eAttachment, targetAttachment: tAttachment }); } }); defer(function () { if (!(_this.options.addTargetClasses === false)) { updateClasses(_this.target, addClasses, allClasses); } updateClasses(_this.element, addClasses, allClasses); }); return { top: top, left: left }; } }); /* globals TetherBase */ 'use strict'; var _TetherBase$Utils = TetherBase.Utils; var getBounds = _TetherBase$Utils.getBounds; var updateClasses = _TetherBase$Utils.updateClasses; var defer = _TetherBase$Utils.defer; TetherBase.modules.push({ position: function position(_ref) { var _this = this; var top = _ref.top; var left = _ref.left; var _cache = this.cache('element-bounds', function () { return getBounds(_this.element); }); var height = _cache.height; var width = _cache.width; var targetPos = this.getTargetBounds(); var bottom = top + height; var right = left + width; var abutted = []; if (top <= targetPos.bottom && bottom >= targetPos.top) { ['left', 'right'].forEach(function (side) { var targetPosSide = targetPos[side]; if (targetPosSide === left || targetPosSide === right) { abutted.push(side); } }); } if (left <= targetPos.right && right >= targetPos.left) { ['top', 'bottom'].forEach(function (side) { var targetPosSide = targetPos[side]; if (targetPosSide === top || targetPosSide === bottom) { abutted.push(side); } }); } var allClasses = []; var addClasses = []; var sides = ['left', 'top', 'right', 'bottom']; allClasses.push(this.getClass('abutted')); sides.forEach(function (side) { allClasses.push(_this.getClass('abutted') + '-' + side); }); if (abutted.length) { addClasses.push(this.getClass('abutted')); } abutted.forEach(function (side) { addClasses.push(_this.getClass('abutted') + '-' + side); }); defer(function () { if (!(_this.options.addTargetClasses === false)) { updateClasses(_this.target, addClasses, allClasses); } updateClasses(_this.element, addClasses, allClasses); }); return true; } }); /* globals TetherBase */ 'use strict'; var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); TetherBase.modules.push({ position: function position(_ref) { var top = _ref.top; var left = _ref.left; if (!this.options.shift) { return; } var shift = this.options.shift; if (typeof this.options.shift === 'function') { shift = this.options.shift.call(this, { top: top, left: left }); } var shiftTop = undefined, shiftLeft = undefined; if (typeof shift === 'string') { shift = shift.split(' '); shift[1] = shift[1] || shift[0]; var _shift = shift; var _shift2 = _slicedToArray(_shift, 2); shiftTop = _shift2[0]; shiftLeft = _shift2[1]; shiftTop = parseFloat(shiftTop, 10); shiftLeft = parseFloat(shiftLeft, 10); } else { shiftTop = shift.top; shiftLeft = shift.left; } top += shiftTop; left += shiftLeft; return { top: top, left: left }; } }); return Tether; })); dist/js/tether.min.js 0000644 00000061061 15073227372 0010552 0 ustar 00 !function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Tether=e()}(this,function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t){var o=t.getBoundingClientRect(),i={};for(var n in o)i[n]=o[n];try{if(t.ownerDocument!==document){var r=t.ownerDocument.defaultView.frameElement;if(r){var s=e(r);i.top+=s.top,i.bottom+=s.top,i.left+=s.left,i.right+=s.left}}}catch(a){}return i}function o(t){var e=getComputedStyle(t)||{},o=e.position,i=[];if("fixed"===o)return[t];for(var n=t;(n=n.parentNode)&&n&&1===n.nodeType;){var r=void 0;try{r=getComputedStyle(n)}catch(s){}if("undefined"==typeof r||null===r)return i.push(n),i;var a=r,f=a.overflow,l=a.overflowX,h=a.overflowY;/(auto|scroll|overlay)/.test(f+h+l)&&("absolute"!==o||["relative","absolute","fixed"].indexOf(r.position)>=0)&&i.push(n)}return i.push(t.ownerDocument.body),t.ownerDocument!==document&&i.push(t.ownerDocument.defaultView),i}function i(){O&&document.body.removeChild(O),O=null}function n(t){var o=void 0;t===document?(o=document,t=document.documentElement):o=t.ownerDocument;var i=o.documentElement,n=e(t),r=A();return n.top-=r.top,n.left-=r.left,"undefined"==typeof n.width&&(n.width=document.body.scrollWidth-n.left-n.right),"undefined"==typeof n.height&&(n.height=document.body.scrollHeight-n.top-n.bottom),n.top=n.top-i.clientTop,n.left=n.left-i.clientLeft,n.right=o.body.clientWidth-n.width-n.left,n.bottom=o.body.clientHeight-n.height-n.top,n}function r(t){return t.offsetParent||document.documentElement}function s(){if(T)return T;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");a(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var o=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=e.clientWidth),document.body.removeChild(e);var n=o-i;return T={width:n,height:n}}function a(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var o in e)({}).hasOwnProperty.call(e,o)&&(t[o]=e[o])}),t}function f(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var o=new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi"),i=d(t).replace(o," ");u(t,i)}}function l(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.add(e)});else{f(t,e);var o=d(t)+(" "+e);u(t,o)}}function h(t,e){if("undefined"!=typeof t.classList)return t.classList.contains(e);var o=d(t);return new RegExp("(^| )"+e+"( |$)","gi").test(o)}function d(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function u(t,e){t.setAttribute("class",e)}function p(t,e,o){o.forEach(function(o){e.indexOf(o)===-1&&h(t,o)&&f(t,o)}),e.forEach(function(e){h(t,e)||l(t,e)})}function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function g(t,e){var o=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+o>=e&&e>=t-o}function m(){return"object"==typeof performance&&"function"==typeof performance.now?performance.now():+new Date}function v(){for(var t={top:0,left:0},e=arguments.length,o=Array(e),i=0;i<e;i++)o[i]=arguments[i];return o.forEach(function(e){var o=e.top,i=e.left;"string"==typeof o&&(o=parseFloat(o,10)),"string"==typeof i&&(i=parseFloat(i,10)),t.top+=o,t.left+=i}),t}function y(t,e){return"string"==typeof t.left&&t.left.indexOf("%")!==-1&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&t.top.indexOf("%")!==-1&&(t.top=parseFloat(t.top,10)/100*e.height),t}function b(t,e){return"scrollParent"===e?e=t.scrollParents[0]:"window"===e&&(e=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),e===document&&(e=e.documentElement),"undefined"!=typeof e.nodeType&&!function(){var t=e,o=n(e),i=o,r=getComputedStyle(e);if(e=[i.left,i.top,o.width+i.left,o.height+i.top],t.ownerDocument!==document){var s=t.ownerDocument.defaultView;e[0]+=s.pageXOffset,e[1]+=s.pageYOffset,e[2]+=s.pageXOffset,e[3]+=s.pageYOffset}I.forEach(function(t,o){t=t[0].toUpperCase()+t.substr(1),"Top"===t||"Left"===t?e[o]+=parseFloat(r["border"+t+"Width"]):e[o]-=parseFloat(r["border"+t+"Width"])})}(),e}var w=function(){function t(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,o,i){return o&&t(e.prototype,o),i&&t(e,i),e}}(),C=void 0;"undefined"==typeof C&&(C={modules:[]});var O=null,E=function(){var t=0;return function(){return++t}}(),x={},A=function(){var t=O;t&&document.body.contains(t)||(t=document.createElement("div"),t.setAttribute("data-tether-id",E()),a(t.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(t),O=t);var o=t.getAttribute("data-tether-id");return"undefined"==typeof x[o]&&(x[o]=e(t),S(function(){delete x[o]})),x[o]},T=null,P=[],S=function(t){P.push(t)},W=function(){for(var t=void 0;t=P.pop();)t()},M=function(){function e(){t(this,e)}return w(e,[{key:"on",value:function(t,e,o){var i=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];"undefined"==typeof this.bindings&&(this.bindings={}),"undefined"==typeof this.bindings[t]&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:i})}},{key:"once",value:function(t,e,o){this.on(t,e,o,!0)}},{key:"off",value:function(t,e){if("undefined"!=typeof this.bindings&&"undefined"!=typeof this.bindings[t])if("undefined"==typeof e)delete this.bindings[t];else for(var o=0;o<this.bindings[t].length;)this.bindings[t][o].handler===e?this.bindings[t].splice(o,1):++o}},{key:"trigger",value:function(t){if("undefined"!=typeof this.bindings&&this.bindings[t]){for(var e=0,o=arguments.length,i=Array(o>1?o-1:0),n=1;n<o;n++)i[n-1]=arguments[n];for(;e<this.bindings[t].length;){var r=this.bindings[t][e],s=r.handler,a=r.ctx,f=r.once,l=a;"undefined"==typeof l&&(l=this),s.apply(l,i),f?this.bindings[t].splice(e,1):++e}}}}]),e}();C.Utils={getActualBoundingClientRect:e,getScrollParents:o,getBounds:n,getOffsetParent:r,extend:a,addClass:l,removeClass:f,hasClass:h,updateClasses:p,defer:S,flush:W,uniqueId:E,Evented:M,getScrollBarSize:s,removeUtilElements:i};var k=function(){function t(t,e){var o=[],i=!0,n=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);i=!0);}catch(f){n=!0,r=f}finally{try{!i&&a["return"]&&a["return"]()}finally{if(n)throw r}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function t(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,o,i){return o&&t(e.prototype,o),i&&t(e,i),e}}(),_=function(t,e,o){for(var i=!0;i;){var n=t,r=e,s=o;i=!1,null===n&&(n=Function.prototype);var a=Object.getOwnPropertyDescriptor(n,r);if(void 0!==a){if("value"in a)return a.value;var f=a.get;if(void 0===f)return;return f.call(s)}var l=Object.getPrototypeOf(n);if(null===l)return;t=l,e=r,o=s,i=!0,a=l=void 0}};if("undefined"==typeof C)throw new Error("You must include the utils.js file before tether.js");var z=C.Utils,o=z.getScrollParents,n=z.getBounds,r=z.getOffsetParent,a=z.extend,l=z.addClass,f=z.removeClass,p=z.updateClasses,S=z.defer,W=z.flush,s=z.getScrollBarSize,i=z.removeUtilElements,B=function(){if("undefined"==typeof document)return"";for(var t=document.createElement("div"),e=["transform","WebkitTransform","OTransform","MozTransform","msTransform"],o=0;o<e.length;++o){var i=e[o];if(void 0!==t.style[i])return i}}(),j=[],F=function(){j.forEach(function(t){t.position(!1)}),W()};!function(){var t=null,e=null,o=null,i=function n(){return"undefined"!=typeof e&&e>16?(e=Math.min(e-16,250),void(o=setTimeout(n,250))):void("undefined"!=typeof t&&m()-t<10||(null!=o&&(clearTimeout(o),o=null),t=m(),F(),e=m()-t))};"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener&&["resize","scroll","touchmove"].forEach(function(t){window.addEventListener(t,i)})}();var Y={center:"center",left:"right",right:"left"},D={middle:"middle",top:"bottom",bottom:"top"},L={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},X=function(t,e){var o=t.left,i=t.top;return"auto"===o&&(o=Y[e.left]),"auto"===i&&(i=D[e.top]),{left:o,top:i}},H=function(t){var e=t.left,o=t.top;return"undefined"!=typeof L[t.left]&&(e=L[t.left]),"undefined"!=typeof L[t.top]&&(o=L[t.top]),{left:e,top:o}},N=function(t){var e=t.split(" "),o=k(e,2),i=o[0],n=o[1];return{top:i,left:n}},R=N,U=function(e){function h(e){var o=this;t(this,h),_(Object.getPrototypeOf(h.prototype),"constructor",this).call(this),this.position=this.position.bind(this),j.push(this),this.history=[],this.setOptions(e,!1),C.modules.forEach(function(t){"undefined"!=typeof t.initialize&&t.initialize.call(o)}),this.position()}return c(h,e),w(h,[{key:"getClass",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=this.options.classes;return"undefined"!=typeof e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+"-"+t:t}},{key:"setOptions",value:function(t){var e=this,i=arguments.length<=1||void 0===arguments[1]||arguments[1],n={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=a(n,t);var r=this.options,s=r.element,f=r.target,h=r.targetModifier;if(this.element=s,this.target=f,this.targetModifier=h,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(t){if("undefined"==typeof e[t])throw new Error("Tether Error: Both element and target must be defined");"undefined"!=typeof e[t].jquery?e[t]=e[t][0]:"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),l(this.element,this.getClass("element")),this.options.addTargetClasses!==!1&&l(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=R(this.options.targetAttachment),this.attachment=R(this.options.attachment),this.offset=N(this.options.offset),this.targetOffset=N(this.options.targetOffset),"undefined"!=typeof this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=o(this.target),this.options.enabled!==!1&&this.enable(i)}},{key:"getTargetBounds",value:function(){if("undefined"==typeof this.targetModifier)return n(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=n(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.top<pageYOffset&&(e.top=pageYOffset),e.left<pageXOffset&&(e.left=pageXOffset),e}if("scroll-handle"===this.targetModifier){var t=void 0,o=this.target;o===document.body?(o=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=n(o);var i=getComputedStyle(o),r=o.scrollWidth>o.clientWidth||[i.overflow,i.overflowX].indexOf("scroll")>=0||this.target!==document.body,s=0;r&&(s=15);var a=t.height-parseFloat(i.borderTopWidth)-parseFloat(i.borderBottomWidth)-s,e={width:15,height:.975*a*(a/o.scrollHeight),left:t.left+t.width-parseFloat(i.borderLeftWidth)-15},f=0;a<408&&this.target===document.body&&(f=-11e-5*Math.pow(a,2)-.00727*a+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var l=this.target.scrollTop/(o.scrollHeight-a);return e.top=l*(a-e.height-f)+t.top+parseFloat(i.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(t,e){return"undefined"==typeof this._cache&&(this._cache={}),"undefined"==typeof this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:"enable",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];this.options.addTargetClasses!==!1&&l(this.target,this.getClass("enabled")),l(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener("scroll",t.position)}),e&&this.position()}},{key:"disable",value:function(){var t=this;f(this.target,this.getClass("enabled")),f(this.element,this.getClass("enabled")),this.enabled=!1,"undefined"!=typeof this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.position)})}},{key:"destroy",value:function(){var t=this;this.disable(),j.forEach(function(e,o){e===t&&j.splice(o,1)}),0===j.length&&i()}},{key:"updateAttachClasses",value:function(t,e){var o=this;t=t||this.attachment,e=e||this.targetAttachment;var i=["left","top","bottom","right","middle","center"];"undefined"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),"undefined"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);var n=this._addAttachClasses;t.top&&n.push(this.getClass("element-attached")+"-"+t.top),t.left&&n.push(this.getClass("element-attached")+"-"+t.left),e.top&&n.push(this.getClass("target-attached")+"-"+e.top),e.left&&n.push(this.getClass("target-attached")+"-"+e.left);var r=[];i.forEach(function(t){r.push(o.getClass("element-attached")+"-"+t),r.push(o.getClass("target-attached")+"-"+t)}),S(function(){"undefined"!=typeof o._addAttachClasses&&(p(o.element,o._addAttachClasses,r),o.options.addTargetClasses!==!1&&p(o.target,o._addAttachClasses,r),delete o._addAttachClasses)})}},{key:"position",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var o=X(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,o);var i=this.cache("element-bounds",function(){return n(t.element)}),a=i.width,f=i.height;if(0===a&&0===f&&"undefined"!=typeof this.lastSize){var l=this.lastSize;a=l.width,f=l.height}else this.lastSize={width:a,height:f};var h=this.cache("target-bounds",function(){return t.getTargetBounds()}),d=h,u=y(H(this.attachment),{width:a,height:f}),p=y(H(o),d),c=y(this.offset,{width:a,height:f}),g=y(this.targetOffset,d);u=v(u,c),p=v(p,g);for(var m=h.left+p.left-u.left,b=h.top+p.top-u.top,w=0;w<C.modules.length;++w){var O=C.modules[w],E=O.position.call(this,{left:m,top:b,targetAttachment:o,targetPos:h,elementPos:i,offset:u,targetOffset:p,manualOffset:c,manualTargetOffset:g,scrollbarSize:P,attachment:this.attachment});if(E===!1)return!1;"undefined"!=typeof E&&"object"==typeof E&&(b=E.top,m=E.left)}var x={page:{top:b,left:m},viewport:{top:b-pageYOffset,bottom:pageYOffset-b-f+innerHeight,left:m-pageXOffset,right:pageXOffset-m-a+innerWidth}},A=this.target.ownerDocument,T=A.defaultView,P=void 0;return T.innerHeight>A.documentElement.clientHeight&&(P=this.cache("scrollbar-size",s),x.viewport.bottom-=P.height),T.innerWidth>A.documentElement.clientWidth&&(P=this.cache("scrollbar-size",s),x.viewport.right-=P.width),["","static"].indexOf(A.body.style.position)!==-1&&["","static"].indexOf(A.body.parentElement.style.position)!==-1||(x.page.bottom=A.body.scrollHeight-b-f,x.page.right=A.body.scrollWidth-m-a),"undefined"!=typeof this.options.optimizations&&this.options.optimizations.moveElement!==!1&&"undefined"==typeof this.targetModifier&&!function(){var e=t.cache("target-offsetparent",function(){return r(t.target)}),o=t.cache("target-offsetparent-bounds",function(){return n(e)}),i=getComputedStyle(e),s=o,a={};if(["Top","Left","Bottom","Right"].forEach(function(t){a[t.toLowerCase()]=parseFloat(i["border"+t+"Width"])}),o.right=A.body.scrollWidth-o.left-s.width+a.right,o.bottom=A.body.scrollHeight-o.top-s.height+a.bottom,x.page.top>=o.top+a.top&&x.page.bottom>=o.bottom&&x.page.left>=o.left+a.left&&x.page.right>=o.right){var f=e.scrollTop,l=e.scrollLeft;x.offset={top:x.page.top-o.top+f-a.top,left:x.page.left-o.left+l-a.left}}}(),this.move(x),this.history.unshift(x),this.history.length>3&&this.history.pop(),e&&W(),!0}}},{key:"move",value:function(t){var e=this;if("undefined"!=typeof this.element.parentNode){var o={};for(var i in t){o[i]={};for(var n in t[i]){for(var s=!1,f=0;f<this.history.length;++f){var l=this.history[f];if("undefined"!=typeof l[i]&&!g(l[i][n],t[i][n])){s=!0;break}}s||(o[i][n]=!0)}}var h={top:"",left:"",right:"",bottom:""},d=function(t,o){var i="undefined"!=typeof e.options.optimizations,n=i?e.options.optimizations.gpu:null;if(n!==!1){var r=void 0,s=void 0;t.top?(h.top=0,r=o.top):(h.bottom=0,r=-o.bottom),t.left?(h.left=0,s=o.left):(h.right=0,s=-o.right),"number"==typeof window.devicePixelRatio&&devicePixelRatio%1===0&&(s=Math.round(s*devicePixelRatio)/devicePixelRatio,r=Math.round(r*devicePixelRatio)/devicePixelRatio),h[B]="translateX("+s+"px) translateY("+r+"px)","msTransform"!==B&&(h[B]+=" translateZ(0)")}else t.top?h.top=o.top+"px":h.bottom=o.bottom+"px",t.left?h.left=o.left+"px":h.right=o.right+"px"},u=!1;if((o.page.top||o.page.bottom)&&(o.page.left||o.page.right)?(h.position="absolute",d(o.page,t.page)):(o.viewport.top||o.viewport.bottom)&&(o.viewport.left||o.viewport.right)?(h.position="fixed",d(o.viewport,t.viewport)):"undefined"!=typeof o.offset&&o.offset.top&&o.offset.left?!function(){h.position="absolute";var i=e.cache("target-offsetparent",function(){return r(e.target)});r(e.element)!==i&&S(function(){e.element.parentNode.removeChild(e.element),i.appendChild(e.element)}),d(o.offset,t.offset),u=!0}():(h.position="absolute",d({top:!0,left:!0},t.page)),!u)if(this.options.bodyElement)this.element.parentNode!==this.options.bodyElement&&this.options.bodyElement.appendChild(this.element);else{for(var p=function(t){var e=t.ownerDocument,o=e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement;return o===t},c=!0,m=this.element.parentNode;m&&1===m.nodeType&&"BODY"!==m.tagName&&!p(m);){if("static"!==getComputedStyle(m).position){c=!1;break}m=m.parentNode}c||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var v={},y=!1;for(var n in h){var b=h[n],w=this.element.style[n];w!==b&&(y=!0,v[n]=b)}y&&S(function(){a(e.element.style,v),e.trigger("repositioned")})}}}]),h}(M);U.modules=[],C.position=F;var V=a(U,C),k=function(){function t(t,e){var o=[],i=!0,n=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);i=!0);}catch(f){n=!0,r=f}finally{try{!i&&a["return"]&&a["return"]()}finally{if(n)throw r}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),z=C.Utils,n=z.getBounds,a=z.extend,p=z.updateClasses,S=z.defer,I=["left","top","right","bottom"];C.modules.push({position:function(t){var e=this,o=t.top,i=t.left,r=t.targetAttachment;if(!this.options.constraints)return!0;var s=this.cache("element-bounds",function(){return n(e.element)}),f=s.height,l=s.width;if(0===l&&0===f&&"undefined"!=typeof this.lastSize){var h=this.lastSize;l=h.width,f=h.height}var d=this.cache("target-bounds",function(){return e.getTargetBounds()}),u=d.height,c=d.width,g=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(t){var e=t.outOfBoundsClass,o=t.pinnedClass;e&&g.push(e),o&&g.push(o)}),g.forEach(function(t){["left","top","right","bottom"].forEach(function(e){g.push(t+"-"+e)})});var m=[],v=a({},r),y=a({},this.attachment);return this.options.constraints.forEach(function(t){var n=t.to,s=t.attachment,a=t.pin;"undefined"==typeof s&&(s="");var h=void 0,d=void 0;if(s.indexOf(" ")>=0){var p=s.split(" "),g=k(p,2);d=g[0],h=g[1]}else h=d=s;var w=b(e,n);"target"!==d&&"both"!==d||(o<w[1]&&"top"===v.top&&(o+=u,v.top="bottom"),o+f>w[3]&&"bottom"===v.top&&(o-=u,v.top="top")),"together"===d&&("top"===v.top&&("bottom"===y.top&&o<w[1]?(o+=u,v.top="bottom",o+=f,y.top="top"):"top"===y.top&&o+f>w[3]&&o-(f-u)>=w[1]&&(o-=f-u,v.top="bottom",y.top="bottom")),"bottom"===v.top&&("top"===y.top&&o+f>w[3]?(o-=u,v.top="top",o-=f,y.top="bottom"):"bottom"===y.top&&o<w[1]&&o+(2*f-u)<=w[3]&&(o+=f-u,v.top="top",y.top="top")),"middle"===v.top&&(o+f>w[3]&&"top"===y.top?(o-=f,y.top="bottom"):o<w[1]&&"bottom"===y.top&&(o+=f,y.top="top"))),"target"!==h&&"both"!==h||(i<w[0]&&"left"===v.left&&(i+=c,v.left="right"),i+l>w[2]&&"right"===v.left&&(i-=c,v.left="left")),"together"===h&&(i<w[0]&&"left"===v.left?"right"===y.left?(i+=c,v.left="right",i+=l,y.left="left"):"left"===y.left&&(i+=c,v.left="right",i-=l,y.left="right"):i+l>w[2]&&"right"===v.left?"left"===y.left?(i-=c,v.left="left",i-=l,y.left="right"):"right"===y.left&&(i-=c,v.left="left",i+=l,y.left="left"):"center"===v.left&&(i+l>w[2]&&"left"===y.left?(i-=l,y.left="right"):i<w[0]&&"right"===y.left&&(i+=l,y.left="left"))),"element"!==d&&"both"!==d||(o<w[1]&&"bottom"===y.top&&(o+=f,y.top="top"),o+f>w[3]&&"top"===y.top&&(o-=f,y.top="bottom")),"element"!==h&&"both"!==h||(i<w[0]&&("right"===y.left?(i+=l,y.left="left"):"center"===y.left&&(i+=l/2,y.left="left")),i+l>w[2]&&("left"===y.left?(i-=l,y.left="right"):"center"===y.left&&(i-=l/2,y.left="right"))),"string"==typeof a?a=a.split(",").map(function(t){return t.trim()}):a===!0&&(a=["top","left","right","bottom"]),a=a||[];var C=[],O=[];o<w[1]&&(a.indexOf("top")>=0?(o=w[1],C.push("top")):O.push("top")),o+f>w[3]&&(a.indexOf("bottom")>=0?(o=w[3]-f,C.push("bottom")):O.push("bottom")),i<w[0]&&(a.indexOf("left")>=0?(i=w[0],C.push("left")):O.push("left")),i+l>w[2]&&(a.indexOf("right")>=0?(i=w[2]-l,C.push("right")):O.push("right")),C.length&&!function(){var t=void 0;t="undefined"!=typeof e.options.pinnedClass?e.options.pinnedClass:e.getClass("pinned"),m.push(t),C.forEach(function(e){m.push(t+"-"+e)})}(),O.length&&!function(){var t=void 0;t="undefined"!=typeof e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass("out-of-bounds"),m.push(t),O.forEach(function(e){m.push(t+"-"+e)})}(),(C.indexOf("left")>=0||C.indexOf("right")>=0)&&(y.left=v.left=!1),(C.indexOf("top")>=0||C.indexOf("bottom")>=0)&&(y.top=v.top=!1),v.top===r.top&&v.left===r.left&&y.top===e.attachment.top&&y.left===e.attachment.left||(e.updateAttachClasses(y,v),e.trigger("update",{attachment:y,targetAttachment:v}))}),S(function(){e.options.addTargetClasses!==!1&&p(e.target,m,g),p(e.element,m,g)}),{top:o,left:i}}});var z=C.Utils,n=z.getBounds,p=z.updateClasses,S=z.defer;C.modules.push({position:function(t){var e=this,o=t.top,i=t.left,r=this.cache("element-bounds",function(){return n(e.element)}),s=r.height,a=r.width,f=this.getTargetBounds(),l=o+s,h=i+a,d=[];o<=f.bottom&&l>=f.top&&["left","right"].forEach(function(t){var e=f[t];e!==i&&e!==h||d.push(t)}),i<=f.right&&h>=f.left&&["top","bottom"].forEach(function(t){var e=f[t];e!==o&&e!==l||d.push(t)});var u=[],c=[],g=["left","top","right","bottom"];return u.push(this.getClass("abutted")),g.forEach(function(t){u.push(e.getClass("abutted")+"-"+t)}),d.length&&c.push(this.getClass("abutted")),d.forEach(function(t){c.push(e.getClass("abutted")+"-"+t)}),S(function(){e.options.addTargetClasses!==!1&&p(e.target,c,u),p(e.element,c,u)}),!0}});var k=function(){function t(t,e){var o=[],i=!0,n=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);i=!0);}catch(f){n=!0,r=f}finally{try{!i&&a["return"]&&a["return"]()}finally{if(n)throw r}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return C.modules.push({position:function(t){var e=t.top,o=t.left;if(this.options.shift){var i=this.options.shift;"function"==typeof this.options.shift&&(i=this.options.shift.call(this,{top:e,left:o}));var n=void 0,r=void 0;if("string"==typeof i){i=i.split(" "),i[1]=i[1]||i[0];var s=i,a=k(s,2);n=a[0],r=a[1],n=parseFloat(n,10),r=parseFloat(r,10)}else n=i.top,r=i.left;return e+=n,o+=r,{top:e,left:o}}}}),V}); component.json 0000644 00000001113 15073227372 0007445 0 ustar 00 { "name": "tether", "repo": "HubSpot/tether", "version": "1.3.10", "description": "A client-side library to make absolutely positioned elements attach to elements in the page efficiently.", "authors": [ "Zack Bloom <zackbloom@gmail.com>", "Adam Schwartz <adam.flynn.schwartz@gmail.com>" ], "maintainers": [ "Nicholas Hwang <nick.joosung.hwang@gmail.com>" ], "license": "MIT", "demo": "http://github.hubspot.com/tether/docs/welcome/", "main": "dist/js/tether.js", "styles": [ "dist/css/tether.css" ], "scripts": [ "dist/js/tether.js" ] }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings