Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Tooltip(props: Props) {
const tippyProps = props;
// HACK: Emulate Android tooltip behavior (hold to show tooltip, tap to
// activate click) on iOS
if (tippyProps.touchHold && bowser.ios) {
tippyProps.trigger = 'focus';
}
return ;
}
var browserQuirks = {
// On most browsers we need to pad the tile edges with repeated pixels so
// that the borders between neighboring tiles aren't apparent.
// On iOS this isn't required, but we must disable it because the padding is
// incorrectly rendered on top of the neighboring tile.
padSize: browser.ios ? 0 : 3,
// In order to prevent fallback tiles from overlapping their children, iOS
// requires smaller zoom levels to be placed below larger zoom levels in
// the CSS 3D coordinate space.
reverseLevelDepth: browser.ios,
// A null transform on the layer element is required so that transitions
// between layers work on iOS.
useNullTransform: browser.ios,
// On Webkit and Gecko browsers, some tiles become invisible at certain
// angles, usually non-floor tiles when looking straight down. Setting the
// translateZ following the perspective transform to a slightly larger value
// than the latter seems to work around this glitch.
perspectiveNudge: browser.webkit || browser.gecko ? 0.001 : 0
};
/**
* @class CssStage
* @extends Stage
* @classdesc
*
* A {@link Stage} implementation using CSS 3D Transforms.
componentDidMount() {
if (this.props.registerHook) {
this.normalizeHook = this.props.registerHook('preSubmit', input => {
if (input.richTextBody) {
return {
...input,
richTextBody: htmlNormalizer(input.richTextBody),
};
}
});
}
// Skip IOS due to a bug, see https://www.pivotaltracker.com/story/show/157434928
if (this.props.isReply && !bowser.ios) {
this.ref.focus();
}
}
let fn = evt => this.dispatchDOMEvent(evt, this.world, morphMethod);
this.handlerFunctions.push({node: globalEmitter, type, fn, capturing});
let arg = { capture: capturing, passive };
globalEmitter.addEventListener(type, fn, arg);
});
this.keyInputHelper = new TextInput(this).install(rootNode);
// rms 6.9.18: In order for us to handle touch events ourselves,
// we need to pass this undocumented touch-action attribute as "none"
// to the body of the document, since iOS does not support the
// CSS property touch-action.
if (bowser.firefox) rootNode.setAttribute("touch-action", "none");
// rms 3.9.19: Setting touch-action to none seems to break the scroll on iOS9 and possibly others.
// setting it to auto seems to fix things for now.
if (bowser.ios) rootNode.setAttribute("touch-action", "auto");
return this;
}
// Add the stage element into the DOM.
this._domElement.appendChild(this._stage.domElement());
// Create control container.
// Controls cannot be placed directly on the root DOM element because
// Hammer.js will prevent click events from reaching the elements beneath.
// The hotspot containers will be added inside the controls container.
this._controlContainer = document.createElement('div');
setAbsolute(this._controlContainer);
setFullSize(this._controlContainer);
// Prevent bounce scroll effect on iOS.
// Applied only for iOS, as Android's events must have the default action to allow interaction with hotspots.
if (browser.ios) {
this._controlContainer.addEventListener('touchmove', function(event) {
event.preventDefault();
});
}
// Old IE does not detect mouse events on elements without background
// Add a child element to the controls with full width, a background color
// and opacity 0
var controlCapture = document.createElement('div');
setAbsolute(controlCapture);
setFullSize(controlCapture);
setBlocking(controlCapture);
this._controlContainer.appendChild(controlCapture);
domElement.appendChild(this._controlContainer);
<p>
Thank you for helping us improve NUSMods. If you have left your email, we will send you
a message when your update goes live
</p>
);
}
if (this.state.submitting) {
return ;
}
// HACK: There's an iOS bug that clips the expanded map around the modal,
// making it impossible to exit the expanded state. While we find a better
// solution for now we'll just hide the button
const showExpandMapBtn = !bowser.ios;
return (
<form>
{this.state.error && (
<div>
<div>
There was a problem submitting your feedback. Please try again later.
</div>
</div>
)}
<div>
<label>Email (optional)</label>
</div></form>
it('cut should be supported on Firefox 41+', function() {
assert.equal(document.queryCommandSupported('cut'), true);
});
}
else {
it('copy should not be supported on Firefox 40-', function() {
assert.equal(document.queryCommandSupported('copy'), false);
});
it('cut should not be supported on Firefox 40-', function() {
assert.equal(document.queryCommandSupported('cut'), false);
});
}
}
if (bowser.safari || bowser.ios) {
it('copy should not be supported on Safari', function() {
assert.equal(document.queryCommandSupported('copy'), false);
});
it('cut should not be supported on Safari', function() {
assert.equal(document.queryCommandSupported('cut'), false);
});
}
if (bowser.msie || bowser.msedge) {
it('copy should be supported on IE', function() {
assert.equal(document.queryCommandSupported('copy'), true);
});
it('cut should be supported on IE', function() {
assert.equal(document.queryCommandSupported('cut'), true);
centerDialog = () => {
let height = this.refs.dialog.offsetHeight / 2,
width = this.refs.dialog.offsetWidth / 2,
midPointY = window.innerHeight / 2 + window.pageYOffset,
midPointX = window.innerWidth / 2 + window.pageXOffset;
midPointY = midPointY - height;
midPointX = midPointX - width;
if (midPointY < 20) {
midPointY = 20;
} else if (Bowser.ios) {
midPointY -= window.pageYOffset;
}
if (midPointX < 20) {
midPointX = 20;
}
this.refs.dialog.style.top = midPointY + "px";
this.refs.dialog.style.left = midPointX + "px";
}
.then(({token}) => {
if (!bowser.safari && !bowser.ios) {
dispatch(handleAuthToken(token));
}
dispatch(hideSignInDialog());
})
.catch((error) => {