mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
fix lint
This commit is contained in:
parent
3e02f247c8
commit
4c5bd71114
@ -19,20 +19,20 @@ import React from "react";
|
|||||||
// derived from code from github.com/noeldelgado/gemini-scrollbar
|
// derived from code from github.com/noeldelgado/gemini-scrollbar
|
||||||
// Copyright (c) Noel Delgado <pixelia.me@gmail.com> (pixelia.me)
|
// Copyright (c) Noel Delgado <pixelia.me@gmail.com> (pixelia.me)
|
||||||
function getScrollbarWidth(alternativeOverflow) {
|
function getScrollbarWidth(alternativeOverflow) {
|
||||||
var e = document.createElement('div'), sw;
|
const div = document.createElement('div');
|
||||||
e.style.position = 'absolute';
|
div.style.position = 'absolute';
|
||||||
e.style.top = '-9999px';
|
div.style.top = '-9999px';
|
||||||
e.style.width = '100px';
|
div.style.width = '100px';
|
||||||
e.style.height = '100px';
|
div.style.height = '100px';
|
||||||
e.style.overflow = "scroll";
|
div.style.overflow = "scroll";
|
||||||
if (alternativeOverflow) {
|
if (alternativeOverflow) {
|
||||||
e.style.overflow = alternativeOverflow;
|
div.style.overflow = alternativeOverflow;
|
||||||
}
|
}
|
||||||
e.style.msOverflowStyle = '-ms-autohiding-scrollbar';
|
div.style.msOverflowStyle = '-ms-autohiding-scrollbar';
|
||||||
document.body.appendChild(e);
|
document.body.appendChild(div);
|
||||||
sw = (e.offsetWidth - e.clientWidth);
|
const scrollbarWidth = (div.offsetWidth - div.clientWidth);
|
||||||
document.body.removeChild(e);
|
document.body.removeChild(div);
|
||||||
return sw;
|
return scrollbarWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
function install() {
|
function install() {
|
||||||
@ -60,11 +60,10 @@ const installBodyClassesIfNeeded = (function() {
|
|||||||
install();
|
install();
|
||||||
installed = true;
|
installed = true;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
export default class AutoHideScrollbar extends React.Component {
|
export default class AutoHideScrollbar extends React.Component {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.onOverflow = this.onOverflow.bind(this);
|
this.onOverflow = this.onOverflow.bind(this);
|
||||||
|
@ -179,10 +179,9 @@ const LeftPanel = React.createClass({
|
|||||||
const RoomList = sdk.getComponent('rooms.RoomList');
|
const RoomList = sdk.getComponent('rooms.RoomList');
|
||||||
const TagPanel = sdk.getComponent('structures.TagPanel');
|
const TagPanel = sdk.getComponent('structures.TagPanel');
|
||||||
const TopLeftMenuButton = sdk.getComponent('structures.TopLeftMenuButton');
|
const TopLeftMenuButton = sdk.getComponent('structures.TopLeftMenuButton');
|
||||||
const BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu');
|
|
||||||
const CallPreview = sdk.getComponent('voip.CallPreview');
|
const CallPreview = sdk.getComponent('voip.CallPreview');
|
||||||
|
|
||||||
let topBox = <TopLeftMenuButton collapsed={ this.props.collapsed }/>;
|
const topBox = <TopLeftMenuButton collapsed={ this.props.collapsed } />;
|
||||||
/*
|
/*
|
||||||
const SearchBox = sdk.getComponent('structures.SearchBox');
|
const SearchBox = sdk.getComponent('structures.SearchBox');
|
||||||
const topBox = <SearchBox collapsed={ this.props.collapsed } onSearch={ this.onSearch } />;
|
const topBox = <SearchBox collapsed={ this.props.collapsed } onSearch={ this.onSearch } />;
|
||||||
|
@ -26,7 +26,6 @@ import Avatar from '../../Avatar';
|
|||||||
const AVATAR_SIZE = 28;
|
const AVATAR_SIZE = 28;
|
||||||
|
|
||||||
export default class TopLeftMenuButton extends React.Component {
|
export default class TopLeftMenuButton extends React.Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
collapsed: PropTypes.bool.isRequired,
|
collapsed: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,6 @@ import dis from '../../../dispatcher';
|
|||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
|
|
||||||
export class TopLeftMenu extends React.Component {
|
export class TopLeftMenu extends React.Component {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.openSettings = this.openSettings.bind(this);
|
this.openSettings = this.openSettings.bind(this);
|
||||||
|
@ -74,7 +74,6 @@ class CollapseDistributor extends FixedDistributor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PercentageDistributor {
|
class PercentageDistributor {
|
||||||
|
|
||||||
constructor(sizer, item, _config, items, container) {
|
constructor(sizer, item, _config, items, container) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.totalSize = sizer.getTotalSize();
|
this.totalSize = sizer.getTotalSize();
|
||||||
|
@ -34,7 +34,6 @@ class RoomSizer extends Sizer {
|
|||||||
item.style.maxHeight = `${Math.round(size)}px`;
|
item.style.maxHeight = `${Math.round(size)}px`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class RoomDistributor extends FixedDistributor {
|
class RoomDistributor extends FixedDistributor {
|
||||||
|
Loading…
Reference in New Issue
Block a user