Plugin Presets.

This commit is contained in:
Robin Davies
2022-03-02 13:26:59 -05:00
parent f677b8b608
commit 2869ec0e00
32 changed files with 2401 additions and 914 deletions
+6 -10
View File
@@ -55,8 +55,6 @@ const NARROW_DISPLAY_THRESHOLD = 600;
const FILTER_STORAGE_KEY = "com.twoplay.pipedal.load_dlg.filter";
let lastClickTime: number = 0;
const pluginGridStyles = (theme: Theme) => createStyles({
frame: {
@@ -327,7 +325,8 @@ export const LoadPluginDialog =
}
onDoubleClick(e: SyntheticEvent, uri: string): void {
this.props.onOk(uri);
// handled with onClick e.detail which provides better behaviour on Chrome.
// this.props.onOk(uri);
}
@@ -342,18 +341,15 @@ export const LoadPluginDialog =
}
onClick(e: SyntheticEvent, uri: string): void {
onClick(e: React.MouseEvent<HTMLDivElement>, uri: string): void {
e.preventDefault();
let currentTime = Date.now();
let dt = currentTime-lastClickTime;
let DOUBLE_CLICK_TIME = 500;
let isDoubleClick = dt < DOUBLE_CLICK_TIME;
lastClickTime = currentTime;
this.setState({ selected_uri: uri });
// a better doubleclick: tracks how many recent clicks in the same area.
// regardless of whether we re-rendered in the interrim.
let isDoubleClick = e.detail === 2;
// we have to synthesize double clicks because
// DOM rewrites interfere with natural double click.
if (isDoubleClick)