Remove double click, add single click to property pane.

This commit is contained in:
Abhinav Jha 2020-01-24 10:44:15 +00:00 committed by Nikhil Nandagopal
parent f231bcb961
commit b1b5f5c669
4 changed files with 32 additions and 14 deletions

View File

@ -45,7 +45,6 @@ const settings: SelectionSettingsModel = {
type GridRef = MutableRefObject<GridComponent | null>;
function reCalculatePageSize(grid: GridRef, height: number) {
console.log("");
if (grid.current) {
const rowHeight: number = grid.current.getRowHeight();
/** Grid height */

View File

@ -7,7 +7,10 @@ import blankImage from "assets/images/blank.png";
import { EditorContext } from "components/editorComponents/EditorContextProvider";
import { ControlIcons } from "icons/ControlIcons";
import { Tooltip } from "@blueprintjs/core";
import { WIDGET_CLASSNAME_PREFIX } from "constants/WidgetConstants";
import {
WIDGET_CLASSNAME_PREFIX,
WidgetTypes,
} from "constants/WidgetConstants";
import { useSelector } from "react-redux";
import { PropertyPaneReduxState } from "reducers/uiReducers/propertyPaneReducer";
import { AppState } from "reducers";
@ -46,6 +49,15 @@ const WidgetBoundaries = styled.div`
pointer-events: none;
`;
const ClickCaptureMask = styled.div`
position: absolute;
left: 0;
top: 5%;
width: 100%;
height: 95%;
z-index: 2;
`;
const DragHandle = styled.div`
position: absolute;
left: 0px;
@ -139,7 +151,11 @@ const DraggableComponent = (props: DraggableComponentProps) => {
};
const togglePropertyEditor = (e: any) => {
if (!propertyPaneState.isVisible) {
if (
(!propertyPaneState.isVisible &&
props.widgetId === propertyPaneState.widgetId) ||
props.widgetId !== propertyPaneState.widgetId
) {
showPropertyPane && showPropertyPane(props.widgetId);
} else {
showPropertyPane && showPropertyPane();
@ -196,15 +212,6 @@ const DraggableComponent = (props: DraggableComponentProps) => {
}}
onClick={(e: any) => {
selectWidget && selectWidget(props.widgetId);
if (
propertyPaneState.widgetId &&
propertyPaneState.widgetId !== props.widgetId
) {
showPropertyPane && showPropertyPane();
}
e.stopPropagation();
}}
onDoubleClick={(e: any) => {
showPropertyPane && showPropertyPane(props.widgetId);
e.stopPropagation();
}}
@ -226,6 +233,18 @@ const DraggableComponent = (props: DraggableComponentProps) => {
zIndex: stackingContext,
}}
>
{selectedWidget !== props.widgetId &&
props.type !== WidgetTypes.CONTAINER_WIDGET && (
<ClickCaptureMask
onClick={(e: any) => {
selectWidget && selectWidget(props.widgetId);
showPropertyPane && showPropertyPane(props.widgetId);
e.preventDefault();
e.stopPropagation();
}}
/>
)}
{props.children}
<DragHandle className="control" ref={drag}>

View File

@ -9,7 +9,7 @@ import { connect } from "react-redux";
import { ActionPayload } from "constants/ActionConstants";
import { FinalActionSelector } from "./ActionSelectorControl";
import { generateReactKey } from "utils/generators";
import styled, { theme } from "constants/DefaultTheme";
import styled from "constants/DefaultTheme";
import { AnyStyledComponent } from "styled-components";
import { FormIcons } from "icons/FormIcons";
export interface ColumnAction {

View File

@ -49,7 +49,7 @@ div.bp3-popover-arrow {
}
.bp3-button.bp3-loading{
cursor: wait !important;
cursor: default !important;
}
.pace {