sforkowany z mirror/soapbox
Merge branch 'detect-passive-events-update' into 'renovate/detect-passive-events-2.x'
Update imports and listenerOptions for components using detect-passive-events See merge request soapbox-pub/soapbox-fe!365reports-section^2
commit
875d03e48d
|
@ -5,9 +5,9 @@ import IconButton from './icon_button';
|
||||||
import Overlay from 'react-overlays/lib/Overlay';
|
import Overlay from 'react-overlays/lib/Overlay';
|
||||||
import Motion from '../features/ui/util/optional_motion';
|
import Motion from '../features/ui/util/optional_motion';
|
||||||
import spring from 'react-motion/lib/spring';
|
import spring from 'react-motion/lib/spring';
|
||||||
import detectPassiveEvents from 'detect-passive-events';
|
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||||
|
|
||||||
const listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;
|
const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
|
||||||
let id = 0;
|
let id = 0;
|
||||||
|
|
||||||
class DropdownMenu extends React.PureComponent {
|
class DropdownMenu extends React.PureComponent {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { EmojiPicker as EmojiPickerAsync } from '../../ui/util/async-components'
|
||||||
import Overlay from 'react-overlays/lib/Overlay';
|
import Overlay from 'react-overlays/lib/Overlay';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import detectPassiveEvents from 'detect-passive-events';
|
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||||
import { buildCustomEmojis } from '../../emoji/emoji';
|
import { buildCustomEmojis } from '../../emoji/emoji';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
|
@ -29,7 +29,7 @@ const assetHost = process.env.CDN_HOST || '';
|
||||||
let EmojiPicker, Emoji; // load asynchronously
|
let EmojiPicker, Emoji; // load asynchronously
|
||||||
|
|
||||||
const backgroundImageFn = () => `${assetHost}/emoji/sheet_10.png`;
|
const backgroundImageFn = () => `${assetHost}/emoji/sheet_10.png`;
|
||||||
const listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;
|
const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
|
||||||
|
|
||||||
const categoriesSort = [
|
const categoriesSort = [
|
||||||
'recent',
|
'recent',
|
||||||
|
|
|
@ -5,7 +5,7 @@ import IconButton from '../../../components/icon_button';
|
||||||
import Overlay from 'react-overlays/lib/Overlay';
|
import Overlay from 'react-overlays/lib/Overlay';
|
||||||
import Motion from '../../ui/util/optional_motion';
|
import Motion from '../../ui/util/optional_motion';
|
||||||
import spring from 'react-motion/lib/spring';
|
import spring from 'react-motion/lib/spring';
|
||||||
import detectPassiveEvents from 'detect-passive-events';
|
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Icon from 'soapbox/components/icon';
|
import Icon from 'soapbox/components/icon';
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ const messages = defineMessages({
|
||||||
change_privacy: { id: 'privacy.change', defaultMessage: 'Adjust post privacy' },
|
change_privacy: { id: 'privacy.change', defaultMessage: 'Adjust post privacy' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;
|
const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
|
||||||
|
|
||||||
class PrivacyDropdownMenu extends React.PureComponent {
|
class PrivacyDropdownMenu extends React.PureComponent {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import { uploadMedia } from 'soapbox/actions/media';
|
||||||
import { SketchPicker } from 'react-color';
|
import { SketchPicker } from 'react-color';
|
||||||
import Overlay from 'react-overlays/lib/Overlay';
|
import Overlay from 'react-overlays/lib/Overlay';
|
||||||
import { isMobile } from 'soapbox/is_mobile';
|
import { isMobile } from 'soapbox/is_mobile';
|
||||||
import detectPassiveEvents from 'detect-passive-events';
|
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||||
import Accordion from '../ui/components/accordion';
|
import Accordion from '../ui/components/accordion';
|
||||||
import SitePreview from './components/site_preview';
|
import SitePreview from './components/site_preview';
|
||||||
import ThemeToggle from 'soapbox/features/ui/components/theme_toggle';
|
import ThemeToggle from 'soapbox/features/ui/components/theme_toggle';
|
||||||
|
@ -40,7 +40,7 @@ const messages = defineMessages({
|
||||||
rawJSONHint: { id: 'soapbox_config.raw_json_hint', defaultMessage: 'Edit the settings data directly. Changes made directly to the JSON file will override the form fields above. Click "Save" to apply your changes.' },
|
rawJSONHint: { id: 'soapbox_config.raw_json_hint', defaultMessage: 'Edit the settings data directly. Changes made directly to the JSON file will override the form fields above. Click "Save" to apply your changes.' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;
|
const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
|
||||||
|
|
||||||
const templates = {
|
const templates = {
|
||||||
promoPanelItem: ImmutableMap({ icon: '', text: '', url: '' }),
|
promoPanelItem: ImmutableMap({ icon: '', text: '', url: '' }),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import detectPassiveEvents from 'detect-passive-events';
|
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||||
|
|
||||||
const LAYOUT_BREAKPOINT = 630;
|
const LAYOUT_BREAKPOINT = 630;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ export function isMobile(width) {
|
||||||
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||||
|
|
||||||
let userTouching = false;
|
let userTouching = false;
|
||||||
let listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;
|
let listenerOptions = supportsPassiveEvents ? { passive: true } : false;
|
||||||
|
|
||||||
function touchListener() {
|
function touchListener() {
|
||||||
userTouching = true;
|
userTouching = true;
|
||||||
|
|
Ładowanie…
Reference in New Issue