remove unused view_tooltip
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
08f88550b1
commit
16b1dbc375
4 changed files with 0 additions and 72 deletions
|
@ -20,10 +20,7 @@ limitations under the License.
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import dis from '../../../dispatcher/dispatcher';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { ViewTooltipPayload } from '../../../dispatcher/payloads/ViewTooltipPayload';
|
|
||||||
import { Action } from '../../../dispatcher/actions';
|
|
||||||
|
|
||||||
const MIN_TOOLTIP_HEIGHT = 25;
|
const MIN_TOOLTIP_HEIGHT = 25;
|
||||||
|
|
||||||
|
@ -68,12 +65,6 @@ export default class Tooltip extends React.Component<IProps> {
|
||||||
|
|
||||||
// Remove the wrapper element, as the tooltip has finished using it
|
// Remove the wrapper element, as the tooltip has finished using it
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
dis.dispatch<ViewTooltipPayload>({
|
|
||||||
action: Action.ViewTooltip,
|
|
||||||
tooltip: null,
|
|
||||||
parent: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
ReactDOM.unmountComponentAtNode(this.tooltipContainer);
|
ReactDOM.unmountComponentAtNode(this.tooltipContainer);
|
||||||
document.body.removeChild(this.tooltipContainer);
|
document.body.removeChild(this.tooltipContainer);
|
||||||
window.removeEventListener('scroll', this.renderTooltip, true);
|
window.removeEventListener('scroll', this.renderTooltip, true);
|
||||||
|
@ -99,7 +90,6 @@ export default class Tooltip extends React.Component<IProps> {
|
||||||
// positioned, also taking into account any window zoom
|
// positioned, also taking into account any window zoom
|
||||||
// NOTE: The additional 6 pixels for the left position, is to take account of the
|
// NOTE: The additional 6 pixels for the left position, is to take account of the
|
||||||
// tooltips chevron
|
// tooltips chevron
|
||||||
const parent = ReactDOM.findDOMNode(this).parentNode as Element;
|
|
||||||
const style = this.updatePosition({});
|
const style = this.updatePosition({});
|
||||||
// Hide the entire container when not visible. This prevents flashing of the tooltip
|
// Hide the entire container when not visible. This prevents flashing of the tooltip
|
||||||
// if it is not meant to be visible on first mount.
|
// if it is not meant to be visible on first mount.
|
||||||
|
@ -119,13 +109,6 @@ export default class Tooltip extends React.Component<IProps> {
|
||||||
|
|
||||||
// Render the tooltip manually, as we wish it not to be rendered within the parent
|
// Render the tooltip manually, as we wish it not to be rendered within the parent
|
||||||
this.tooltip = ReactDOM.render<Element>(tooltip, this.tooltipContainer);
|
this.tooltip = ReactDOM.render<Element>(tooltip, this.tooltipContainer);
|
||||||
|
|
||||||
// Tell the roomlist about us so it can manipulate us if it wishes
|
|
||||||
dis.dispatch<ViewTooltipPayload>({
|
|
||||||
action: Action.ViewTooltip,
|
|
||||||
tooltip: this.tooltip,
|
|
||||||
parent: parent,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
|
|
|
@ -230,9 +230,6 @@ export default createReactClass({
|
||||||
|
|
||||||
onAction: function(payload) {
|
onAction: function(payload) {
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'view_tooltip':
|
|
||||||
this.tooltip = payload.tooltip;
|
|
||||||
break;
|
|
||||||
case 'call_state':
|
case 'call_state':
|
||||||
var call = CallHandler.getCall(payload.room_id);
|
var call = CallHandler.getCall(payload.room_id);
|
||||||
if (call && call.call_state === 'ringing') {
|
if (call && call.call_state === 'ringing') {
|
||||||
|
@ -589,18 +586,6 @@ export default createReactClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_whenScrolling: function(e) {
|
|
||||||
this._hideTooltip(e);
|
|
||||||
this._repositionIncomingCallBox(e, false);
|
|
||||||
},
|
|
||||||
|
|
||||||
_hideTooltip: function(e) {
|
|
||||||
// Hide tooltip when scrolling, as we'll no longer be over the one we were on
|
|
||||||
if (this.tooltip && this.tooltip.style.display !== "none") {
|
|
||||||
this.tooltip.style.display = "none";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_repositionIncomingCallBox: function(e, firstTime) {
|
_repositionIncomingCallBox: function(e, firstTime) {
|
||||||
const incomingCallBox = document.getElementById("incomingCallBox");
|
const incomingCallBox = document.getElementById("incomingCallBox");
|
||||||
if (incomingCallBox && incomingCallBox.parentElement) {
|
if (incomingCallBox && incomingCallBox.parentElement) {
|
||||||
|
|
|
@ -45,11 +45,6 @@ export enum Action {
|
||||||
*/
|
*/
|
||||||
ViewRoomDirectory = "view_room_directory",
|
ViewRoomDirectory = "view_room_directory",
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the current tooltip. Should be use with ViewTooltipPayload.
|
|
||||||
*/
|
|
||||||
ViewTooltip = "view_tooltip",
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forces the theme to reload. No additional payload information required.
|
* Forces the theme to reload. No additional payload information required.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ActionPayload } from "../payloads";
|
|
||||||
import { Action } from "../actions";
|
|
||||||
import { Component } from "react";
|
|
||||||
|
|
||||||
export interface ViewTooltipPayload extends ActionPayload {
|
|
||||||
action: Action.ViewTooltip;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The tooltip to render. If it's null the tooltip will not be rendered
|
|
||||||
* We need the void type because of typescript headaches.
|
|
||||||
*/
|
|
||||||
tooltip: null | void | Element | Component<Element, any, any>;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The parent under which to render the tooltip. Can be null to remove
|
|
||||||
* the parent type.
|
|
||||||
*/
|
|
||||||
parent: null | Element;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue