mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
lint fixes
This commit is contained in:
parent
c00e677878
commit
ef48e2343f
67 changed files with 172 additions and 171 deletions
|
@ -4,6 +4,7 @@ electron/about/*
|
|||
src/json/schema
|
||||
licenses.json
|
||||
**/*.js
|
||||
extension/*
|
||||
|
||||
# generated by update.sh
|
||||
*-arm64/
|
||||
|
|
|
@ -411,8 +411,8 @@ const BlockCover = observer(class BlockCover extends React.Component<I.BlockComp
|
|||
node.addClass('isDragging');
|
||||
|
||||
win.off('mousemove.cover mouseup.cover');
|
||||
win.on('mousemove.cover', e => this.onDragMove(e));
|
||||
win.on('mouseup.cover', e => this.onDragEnd(e));
|
||||
win.on('mousemove.cover', e => this.onDragMove(e));
|
||||
win.on('mouseup.cover', e => this.onDragEnd(e));
|
||||
};
|
||||
|
||||
onDragMove (e: any) {
|
||||
|
|
|
@ -47,7 +47,7 @@ const CellFile = observer(class CellFile extends React.Component<I.Cell, State>
|
|||
};
|
||||
|
||||
const Item = (item: any) => (
|
||||
<div className="element" onClick={e => this.onClick(e, item)}>
|
||||
<div className="element" onClick={e => this.onClick(e, item)}>
|
||||
<div className="flex">
|
||||
<IconObject object={item} size={iconSize} />
|
||||
<div className="name">{UtilFile.name(item)}</div>
|
||||
|
|
|
@ -350,7 +350,7 @@ const CellSelect = observer(class CellSelect extends React.Component<I.Cell, Sta
|
|||
};
|
||||
|
||||
let items = record && relation ? Relation.getOptions(record[relation.relationKey]) : [];
|
||||
items.filter(it => it && !it._empty_ && !it.isArchived && !it.isDeleted);
|
||||
items = items.filter(it => it && !it._empty_ && !it.isArchived && !it.isDeleted);
|
||||
|
||||
return items;
|
||||
};
|
||||
|
|
|
@ -108,7 +108,7 @@ const ViewBoard = observer(class ViewBoard extends React.Component<I.ViewCompone
|
|||
this.unbind();
|
||||
|
||||
const node = $(this.node);
|
||||
node.find('#scroll').on('scroll', e => this.onScrollView());
|
||||
node.find('#scroll').on('scroll', e => this.onScrollView());
|
||||
};
|
||||
|
||||
unbind () {
|
||||
|
@ -267,7 +267,7 @@ const ViewBoard = observer(class ViewBoard extends React.Component<I.ViewCompone
|
|||
clone.attr({ id: '' }).addClass('isClone').css({ zIndex: 10000, position: 'fixed', left: -10000, top: -10000 });
|
||||
view.append(clone);
|
||||
|
||||
$(document).off('dragover').on('dragover', e => e.preventDefault());
|
||||
$(document).off('dragover').on('dragover', e => e.preventDefault());
|
||||
$(window).off('dragend.board drag.board');
|
||||
$('body').addClass('grab');
|
||||
|
||||
|
@ -310,8 +310,8 @@ const ViewBoard = observer(class ViewBoard extends React.Component<I.ViewCompone
|
|||
this.initCacheColumn();
|
||||
this.isDraggingColumn = true;
|
||||
|
||||
win.on('drag.board', e => this.onDragMoveColumn(e, groupId));
|
||||
win.on('dragend.board', e => this.onDragEndColumn(e, groupId));
|
||||
win.on('drag.board', e => this.onDragMoveColumn(e, groupId));
|
||||
win.on('dragend.board', e => this.onDragEndColumn(e, groupId));
|
||||
};
|
||||
|
||||
onDragMoveColumn (e: any, groupId: any) {
|
||||
|
|
|
@ -259,8 +259,8 @@ const ViewGrid = observer(class ViewGrid extends React.Component<I.ViewComponent
|
|||
|
||||
$('body').addClass('colResize');
|
||||
win.off('mousemove.cell mouseup.cell');
|
||||
win.on('mousemove.cell', e => this.onResizeMove(e, relationKey));
|
||||
win.on('mouseup.cell', e => this.onResizeEnd(e, relationKey));
|
||||
win.on('mousemove.cell', e => this.onResizeMove(e, relationKey));
|
||||
win.on('mouseup.cell', e => this.onResizeEnd(e, relationKey));
|
||||
|
||||
el.addClass('isResizing');
|
||||
keyboard.setResize(true);
|
||||
|
|
|
@ -61,7 +61,7 @@ const BodyCell = observer(class BodyCell extends React.Component<Props> {
|
|||
key={id}
|
||||
id={id}
|
||||
className={cn.join(' ')}
|
||||
onClick={e => onCellClick(e, relation.relationKey, record.id)}
|
||||
onClick={e => onCellClick(e, relation.relationKey, record.id)}
|
||||
>
|
||||
<Cell
|
||||
ref={ref => {
|
||||
|
|
|
@ -48,7 +48,7 @@ const HeadCell = observer(class HeadCell extends React.Component<Props> {
|
|||
>
|
||||
<div className="cellContent">
|
||||
<Handle name={name} format={format} readonly={readonly} />
|
||||
<div className="resize" onMouseDown={e => onResizeStart(e, relationKey)} />
|
||||
<div className="resize" onMouseDown={e => onResizeStart(e, relationKey)} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -77,7 +77,7 @@ const BlockFeatured = observer(class BlockFeatured extends React.Component<Props
|
|||
id={Relation.cellId(PREFIX, 'type', object.id)}
|
||||
className="cellContent type"
|
||||
onClick={this.onType}
|
||||
onMouseEnter={e => this.onMouseEnter(e, 'type')}
|
||||
onMouseEnter={e => this.onMouseEnter(e, 'type')}
|
||||
onMouseLeave={this.onMouseLeave}
|
||||
>
|
||||
{typeName}
|
||||
|
@ -127,7 +127,7 @@ const BlockFeatured = observer(class BlockFeatured extends React.Component<Props
|
|||
id={Relation.cellId(PREFIX, 'setOf', object.id)}
|
||||
className="cellContent setOf"
|
||||
onClick={this.onSource}
|
||||
onMouseEnter={e => this.onMouseEnter(e, 'setOf', 'Query')}
|
||||
onMouseEnter={e => this.onMouseEnter(e, 'setOf', 'Query')}
|
||||
onMouseLeave={this.onMouseLeave}
|
||||
>
|
||||
{setOfString.length ? (
|
||||
|
|
|
@ -568,8 +568,8 @@ const Block = observer(class Block extends React.Component<Props> {
|
|||
node.find('.colResize.active').removeClass('active');
|
||||
node.find('.colResize.c' + index).addClass('active');
|
||||
|
||||
win.on('mousemove.block', e => this.onResize(e, index, offset));
|
||||
win.on('mouseup.block', e => this.onResizeEnd(e, index, offset));
|
||||
win.on('mousemove.block', e => this.onResize(e, index, offset));
|
||||
win.on('mouseup.block', e => this.onResizeEnd(e, index, offset));
|
||||
|
||||
node.find('.resizable').trigger('resizeStart', [ e ]);
|
||||
};
|
||||
|
|
|
@ -69,13 +69,13 @@ const BlockImage = observer(class BlockImage extends React.Component<I.BlockComp
|
|||
<img
|
||||
className="mediaImage"
|
||||
src={commonStore.imageUrl(targetObjectId, Constant.size.image)}
|
||||
onDragStart={e => e.preventDefault()}
|
||||
onDragStart={e => e.preventDefault()}
|
||||
onClick={this.onClick}
|
||||
onLoad={this.onLoad}
|
||||
onError={this.onError}
|
||||
/>
|
||||
<Icon className="download" onClick={this.onDownload} />
|
||||
<Icon className="resize" onMouseDown={e => this.onResizeStart(e, false)} />
|
||||
<Icon className="resize" onMouseDown={e => this.onResizeStart(e, false)} />
|
||||
</div>
|
||||
);
|
||||
break;
|
||||
|
@ -159,8 +159,8 @@ const BlockImage = observer(class BlockImage extends React.Component<I.BlockComp
|
|||
|
||||
keyboard.disableSelection(true);
|
||||
node.addClass('isResizing');
|
||||
win.on('mousemove.media', e => this.onResize(e, checkMax));
|
||||
win.on('mouseup.media', e => this.onResizeEnd(e, checkMax));
|
||||
win.on('mousemove.media', e => this.onResize(e, checkMax));
|
||||
win.on('mouseup.media', e => this.onResizeEnd(e, checkMax));
|
||||
};
|
||||
|
||||
onResize (e: any, checkMax: boolean) {
|
||||
|
|
|
@ -839,8 +839,8 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
|
||||
body.addClass('colResize');
|
||||
win.off('mousemove.table mouseup.table');
|
||||
win.on('mousemove.table', throttle(e => this.onResizeMove(e, id), 40));
|
||||
win.on('mouseup.table', e => this.onResizeEnd(e, id));
|
||||
win.on('mousemove.table', throttle(e => this.onResizeMove(e, id), 40));
|
||||
win.on('mouseup.table', e => this.onResizeEnd(e, id));
|
||||
|
||||
keyboard.setResize(true);
|
||||
};
|
||||
|
@ -921,11 +921,11 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
table.css({ width: widths[idx], zIndex: 10000, position: 'fixed', left: -10000, top: -10000 });
|
||||
node.append(table);
|
||||
|
||||
$(document).off('dragover').on('dragover', e => e.preventDefault());
|
||||
$(document).off('dragover').on('dragover', e => e.preventDefault());
|
||||
e.dataTransfer.setDragImage(table.get(0), table.outerWidth(), 0);
|
||||
|
||||
win.on('drag.tableColumn', throttle(e => this.onDragMoveColumn(e, id), 40));
|
||||
win.on('dragend.tableColumn', e => this.onDragEndColumn(e, id));
|
||||
win.on('drag.tableColumn', throttle(e => this.onDragMoveColumn(e, id), 40));
|
||||
win.on('dragend.tableColumn', e => this.onDragEndColumn(e, id));
|
||||
|
||||
this.initCache(I.BlockType.TableColumn);
|
||||
this.setEditing('');
|
||||
|
@ -1013,11 +1013,11 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
layer.append(table);
|
||||
table.append(clone);
|
||||
|
||||
$(document).off('dragover').on('dragover', e => e.preventDefault());
|
||||
$(document).off('dragover').on('dragover', e => e.preventDefault());
|
||||
e.dataTransfer.setDragImage(layer.get(0), 0, table.outerHeight());
|
||||
|
||||
win.on('drag.tableRow', throttle(e => this.onDragMoveRow(e, id), 40));
|
||||
win.on('dragend.tableRow', e => this.onDragEndRow(e, id));
|
||||
win.on('drag.tableRow', throttle(e => this.onDragMoveRow(e, id), 40));
|
||||
win.on('dragend.tableRow', e => this.onDragEndRow(e, id));
|
||||
|
||||
this.initCache(I.BlockType.TableRow);
|
||||
this.setEditing('');
|
||||
|
|
|
@ -49,8 +49,8 @@ const BlockTableCell = observer(class BlockTableCell extends React.Component<Pro
|
|||
case I.BlockType.TableColumn:
|
||||
cn.push('handleColumn canDrag');
|
||||
|
||||
onDragStart = e => onDragStartColumn(e, column.id);
|
||||
onClick = e => onHandleColumn(e, item.type, row.id, column.id, cellId);
|
||||
onDragStart = e => onDragStartColumn(e, column.id);
|
||||
onClick = e => onHandleColumn(e, item.type, row.id, column.id, cellId);
|
||||
break;
|
||||
|
||||
case I.BlockType.TableRow:
|
||||
|
@ -58,9 +58,9 @@ const BlockTableCell = observer(class BlockTableCell extends React.Component<Pro
|
|||
canDrag = !isHeader;
|
||||
|
||||
if (canDrag) {
|
||||
onDragStart = e => onDragStartRow(e, row.id);
|
||||
onDragStart = e => onDragStartRow(e, row.id);
|
||||
};
|
||||
onClick = e => onHandleRow(e, item.type, row.id, column.id, cellId);
|
||||
onClick = e => onHandleRow(e, item.type, row.id, column.id, cellId);
|
||||
break;
|
||||
};
|
||||
|
||||
|
@ -72,8 +72,8 @@ const BlockTableCell = observer(class BlockTableCell extends React.Component<Pro
|
|||
<div
|
||||
className={cn.join(' ')}
|
||||
draggable={canDrag}
|
||||
onMouseEnter={e => onEnterHandle(e, item.type, row.id, column.id)}
|
||||
onMouseLeave={e => onLeaveHandle(e)}
|
||||
onMouseEnter={e => onEnterHandle(e, item.type, row.id, column.id)}
|
||||
onMouseLeave={e => onLeaveHandle(e)}
|
||||
onClick={onClick}
|
||||
onDragStart={onDragStart}
|
||||
onContextMenu={onClick}
|
||||
|
@ -145,23 +145,23 @@ const BlockTableCell = observer(class BlockTableCell extends React.Component<Pro
|
|||
onCellKeyUp(e, row.id, column.id, cellId, text, marks, range, props);
|
||||
}}
|
||||
onUpdate={() => onCellUpdate(cellId)}
|
||||
onFocus={e => onCellFocus(e, row.id, column.id, cellId)}
|
||||
onBlur={e => onCellBlur(e, row.id, column.id, cellId)}
|
||||
onFocus={e => onCellFocus(e, row.id, column.id, cellId)}
|
||||
onBlur={e => onCellBlur(e, row.id, column.id, cellId)}
|
||||
getWrapperWidth={() => Constant.size.editor}
|
||||
/>
|
||||
) : (
|
||||
<EmptyBlock />
|
||||
)}
|
||||
|
||||
{!readonly ? <div className="resize" onMouseDown={e => onResizeStart(e, column.id)} /> : ''}
|
||||
<Icon className="menu" inner={inner} onClick={e => onOptions(e, I.BlockType.Text, row.id, column.id, cellId)} />
|
||||
{!readonly ? <div className="resize" onMouseDown={e => onResizeStart(e, column.id)} /> : ''}
|
||||
<Icon className="menu" inner={inner} onClick={e => onOptions(e, I.BlockType.Text, row.id, column.id, cellId)} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
onMouseDown (e: any) {
|
||||
keyboard.disableSelection(true);
|
||||
$(window).off('mousedown.table-cell').on('mousedown.table-cell', e => keyboard.disableSelection(false));
|
||||
$(window).off('mousedown.table-cell').on('mousedown.table-cell', e => keyboard.disableSelection(false));
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ const BlockTableOfContents = observer(class BlockTableOfContents extends React.C
|
|||
return (
|
||||
<div
|
||||
className="item"
|
||||
onClick={e => this.onClick(e, item.id)}
|
||||
onClick={e => this.onClick(e, item.id)}
|
||||
style={{ paddingLeft: item.depth * 24 }}
|
||||
>
|
||||
<span>{item.text}</span>
|
||||
|
|
|
@ -203,7 +203,7 @@ const BlockText = observer(class BlockText extends React.Component<Props> {
|
|||
onMouseDown={this.onMouseDown}
|
||||
onMouseUp={this.onMouseUp}
|
||||
onInput={this.onInput}
|
||||
onDragStart={e => e.preventDefault()}
|
||||
onDragStart={e => e.preventDefault()}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -32,8 +32,8 @@ const BlockType = observer(class BlockType extends React.Component<I.BlockCompon
|
|||
<div
|
||||
id={'item-' + item.id}
|
||||
className="item"
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onMouseLeave={this.onOut}
|
||||
>
|
||||
{item.icon ? <Icon className={item.icon} /> : ''}
|
||||
|
|
|
@ -102,8 +102,8 @@ class DragBox extends React.Component<Props> {
|
|||
element.addClass('isDragging');
|
||||
|
||||
win.off('mousemove.dragbox mouseup.dragbox');
|
||||
win.on('mousemove.dragbox', e => this.onDragMove(e));
|
||||
win.on('mouseup.dragbox', e => this.onDragEnd(e));
|
||||
win.on('mousemove.dragbox', e => this.onDragMove(e));
|
||||
win.on('mouseup.dragbox', e => this.onDragEnd(e));
|
||||
};
|
||||
|
||||
onDragMove (e: any) {
|
||||
|
|
|
@ -235,8 +235,8 @@ const DragProvider = observer(class DragProvider extends React.Component<Props>
|
|||
keyboard.disableSelection(true);
|
||||
Preview.hideAll();
|
||||
|
||||
win.on('drag.drag', e => this.onDrag(e));
|
||||
win.on('dragend.drag', e => this.onDragEnd(e));
|
||||
win.on('drag.drag', e => this.onDrag(e));
|
||||
win.on('dragend.drag', e => this.onDragEnd(e));
|
||||
|
||||
container.off('scroll.drag').on('scroll.drag', throttle(() => this.onScroll(), 20));
|
||||
sidebar.off('scroll.drag').on('scroll.drag', throttle(() => this.onScroll(), 20));
|
||||
|
|
|
@ -61,8 +61,8 @@ class MenuBlockAction extends React.Component<I.Menu, State> {
|
|||
<MenuItemVertical
|
||||
key={i}
|
||||
{...action}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
|
|
@ -50,8 +50,8 @@ const MenuBlockAdd = observer(class MenuBlockAdd extends React.Component<I.Menu>
|
|||
<div
|
||||
id="item-relation-add"
|
||||
className="item add"
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
style={param.style}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
|
@ -135,8 +135,8 @@ const MenuBlockAdd = observer(class MenuBlockAdd extends React.Component<I.Menu>
|
|||
{...item}
|
||||
className={cn.join(' ')}
|
||||
withDescription={item.isBlock}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
style={param.style}
|
||||
/>
|
||||
);
|
||||
|
@ -256,7 +256,7 @@ const MenuBlockAdd = observer(class MenuBlockAdd extends React.Component<I.Menu>
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class MenuBlockHAlign extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ class MenuBlockBackground extends React.Component<I.Menu> {
|
|||
icon="color"
|
||||
inner={inner}
|
||||
checkbox={action.value == value}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -47,7 +47,7 @@ class MenuBlockBackground extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ class MenuBlockColor extends React.Component<I.Menu> {
|
|||
icon="color"
|
||||
inner={inner}
|
||||
checkbox={action.value == value}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -47,7 +47,7 @@ class MenuBlockColor extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ const MenuBlockContext = observer(class MenuBlockContext extends React.Component
|
|||
<div className="flex">
|
||||
{canTurn ? (
|
||||
<div className="section">
|
||||
<Icon id={'button-' + blockId + '-style'} arrow={true} tooltip={translate('menuBlockContextSwitchStyle')} tooltipY={I.MenuDirection.Top} className={[ styleIcon, 'blockStyle' ].join(' ')} onMouseDown={e => this.onMark(e, 'style')} />
|
||||
<Icon id={'button-' + blockId + '-style'} arrow={true} tooltip={translate('menuBlockContextSwitchStyle')} tooltipY={I.MenuDirection.Top} className={[ styleIcon, 'blockStyle' ].join(' ')} onMouseDown={e => this.onMark(e, 'style')} />
|
||||
</div>
|
||||
) : ''}
|
||||
|
||||
|
@ -91,7 +91,7 @@ const MenuBlockContext = observer(class MenuBlockContext extends React.Component
|
|||
tooltip={action.name}
|
||||
tooltipCaption={action.caption}
|
||||
tooltipY={I.MenuDirection.Top}
|
||||
onMouseDown={e => this.onMark(e, action.type)}
|
||||
onMouseDown={e => this.onMark(e, action.type)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -106,7 +106,7 @@ const MenuBlockContext = observer(class MenuBlockContext extends React.Component
|
|||
tooltip={translate('commonColor')}
|
||||
tooltipCaption={`${cmd} + Shift + C`}
|
||||
tooltipY={I.MenuDirection.Top}
|
||||
onMouseDown={e => this.onMark(e, I.MarkType.Color)}
|
||||
onMouseDown={e => this.onMark(e, I.MarkType.Color)}
|
||||
/>
|
||||
|
||||
<Icon
|
||||
|
@ -116,7 +116,7 @@ const MenuBlockContext = observer(class MenuBlockContext extends React.Component
|
|||
tooltip={translate('commonBackground')}
|
||||
tooltipCaption={`${cmd} + Shift + H`}
|
||||
tooltipY={I.MenuDirection.Top}
|
||||
onMouseDown={e => this.onMark(e, I.MarkType.BgColor)}
|
||||
onMouseDown={e => this.onMark(e, I.MarkType.BgColor)}
|
||||
/>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
@ -136,7 +136,7 @@ const MenuBlockContext = observer(class MenuBlockContext extends React.Component
|
|||
className="more"
|
||||
tooltip={translate('menuBlockContextMoreOptions')}
|
||||
tooltipY={I.MenuDirection.Top}
|
||||
onMouseDown={e => this.onMark(e, 'more')}
|
||||
onMouseDown={e => this.onMark(e, 'more')}
|
||||
/>
|
||||
</div>
|
||||
) : ''}
|
||||
|
|
|
@ -56,7 +56,7 @@ const MenuBlockCover = observer(class MenuBlockCover extends React.Component<I.M
|
|||
const sections = this.getSections();
|
||||
|
||||
const Item = (item: any) => (
|
||||
<div className="item" onClick={e => this.onSelect(e, item)}>
|
||||
<div className="item" onClick={e => this.onSelect(e, item)}>
|
||||
<Cover preview={true} {...item} />
|
||||
{item.artist ? <div className="name">{item.artist}</div> : ''}
|
||||
</div>
|
||||
|
|
|
@ -178,7 +178,7 @@ const MenuBlockLatex = observer(class MenuBlockLatex extends React.Component<I.M
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ class MenuBlockLayout extends React.Component<I.Menu> {
|
|||
{...action}
|
||||
icon={action.icon || action.id}
|
||||
checkbox={action.id == value}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
@ -61,7 +61,7 @@ class MenuBlockLayout extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -92,8 +92,8 @@ const MenuBlockLink = observer(class MenuBlockLink extends React.Component<I.Men
|
|||
object={object}
|
||||
icon={item.icon}
|
||||
name={<ObjectName object={item} />}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
withDescription={item.isBig}
|
||||
description={type ? type.name : undefined}
|
||||
style={param.style}
|
||||
|
@ -206,7 +206,7 @@ const MenuBlockLink = observer(class MenuBlockLink extends React.Component<I.Men
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ const MenuBlockLinkSettings = observer(class MenuBlockLinkSettings extends React
|
|||
<MenuItemVertical
|
||||
key={i}
|
||||
{...action}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
@ -60,7 +60,7 @@ const MenuBlockLinkSettings = observer(class MenuBlockLinkSettings extends React
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -72,8 +72,8 @@ const MenuBlockMention = observer(class MenuBlockMention extends React.Component
|
|||
object={item.id == 'add' ? undefined : item}
|
||||
icon={item.icon}
|
||||
name={<ObjectName object={item} />}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
caption={type ? type.name : undefined}
|
||||
style={param.style}
|
||||
className={cn.join(' ')}
|
||||
|
@ -162,7 +162,7 @@ const MenuBlockMention = observer(class MenuBlockMention extends React.Component
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -38,8 +38,8 @@ class MenuBlockMore extends React.Component<I.Menu> {
|
|||
key={i}
|
||||
{...action}
|
||||
icon={action.icon || action.id}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -83,7 +83,7 @@ class MenuBlockMore extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ const MenuBlockRelationView = observer(class MenuBlockRelationView extends React
|
|||
);
|
||||
|
||||
const ItemAdd = () => (
|
||||
<div id="item-add" className="item add" onClick={e => this.onAdd(e)}>
|
||||
<div id="item-add" className="item add" onClick={e => this.onAdd(e)}>
|
||||
<div className="line" />
|
||||
<div className="info">
|
||||
<Icon className="plus" />
|
||||
|
@ -111,7 +111,7 @@ const MenuBlockRelationView = observer(class MenuBlockRelationView extends React
|
|||
const scrollWrap = node.find('#scrollWrap');
|
||||
|
||||
this.resize();
|
||||
scrollWrap.off('scroll').on('scroll', e => this.onScroll());
|
||||
scrollWrap.off('scroll').on('scroll', e => this.onScroll());
|
||||
|
||||
this.selectionPrevent(true);
|
||||
};
|
||||
|
|
|
@ -26,8 +26,8 @@ const MenuBlockStyle = observer(class MenuBlockStyle extends React.Component<I.M
|
|||
key={i}
|
||||
{...action}
|
||||
checkbox={action.itemId == active}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onOver(e, action)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
@ -52,7 +52,7 @@ const MenuBlockStyle = observer(class MenuBlockStyle extends React.Component<I.M
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ const MenuButton = observer(class MenuButton extends React.Component<I.Menu> {
|
|||
key={i}
|
||||
{...item}
|
||||
className={disabled ? 'disabled' : ''}
|
||||
onClick={e => this.onSelect(e, item)}
|
||||
onClick={e => this.onSelect(e, item)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -37,8 +37,8 @@ class MenuContext extends React.Component<I.Menu> {
|
|||
key={i}
|
||||
{...action}
|
||||
icon={action.icon || action.id}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -71,7 +71,7 @@ class MenuContext extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ const MenuDataviewDate = observer(class MenuDataviewDate extends React.Component
|
|||
<MenuItemVertical
|
||||
key={i}
|
||||
{...action}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
@ -59,7 +59,7 @@ const MenuDataviewDate = observer(class MenuDataviewDate extends React.Component
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ const MenuDataviewFileList = observer(class MenuDataviewFileList extends React.C
|
|||
let content = null;
|
||||
if (item.id == 'add') {
|
||||
content = (
|
||||
<div id="item-add" className="item add" onMouseEnter={e => this.onOver(e, item)} onClick={e => this.onClick(e, item)} style={param.style}>
|
||||
<div id="item-add" className="item add" onMouseEnter={e => this.onOver(e, item)} onClick={e => this.onClick(e, item)} style={param.style}>
|
||||
<Icon className="plus" />
|
||||
<div className="name">{item.name}</div>
|
||||
</div>
|
||||
|
@ -69,8 +69,8 @@ const MenuDataviewFileList = observer(class MenuDataviewFileList extends React.C
|
|||
id={item.id}
|
||||
object={item}
|
||||
name={UtilFile.name(item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
caption={type ? type.name : undefined}
|
||||
style={param.style}
|
||||
/>
|
||||
|
@ -176,7 +176,7 @@ const MenuDataviewFileList = observer(class MenuDataviewFileList extends React.C
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -70,11 +70,11 @@ const MenuDataviewFileValues = observer(class MenuDataviewFileValues extends Rea
|
|||
return (
|
||||
<div id={'item-' + item.id} className={cn.join(' ')}>
|
||||
<Handle />
|
||||
<div className="clickable" onClick={e => UtilObject.openPopup(item)}>
|
||||
<div className="clickable" onClick={e => UtilObject.openPopup(item)}>
|
||||
{content}
|
||||
</div>
|
||||
<div className="buttons">
|
||||
<Icon className="more" onClick={e => this.onMore(e, item)} />
|
||||
<Icon className="more" onClick={e => this.onMore(e, item)} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -68,9 +68,9 @@ const MenuFilterList = observer(class MenuFilterList extends React.Component<I.M
|
|||
index={param.index}
|
||||
style={param.style}
|
||||
readonly={!allowedView}
|
||||
onOver={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onRemove={e => this.onRemove(e, item)}
|
||||
onOver={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onRemove={e => this.onRemove(e, item)}
|
||||
/>
|
||||
</CellMeasurer>
|
||||
);
|
||||
|
@ -185,7 +185,7 @@ const MenuFilterList = observer(class MenuFilterList extends React.Component<I.M
|
|||
obj.off('click').on('click', () => menuStore.closeAll(Constant.menuIds.cell));
|
||||
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ const MenuDataviewFilterValues = observer(class MenuDataviewFilterValues extends
|
|||
let value = null;
|
||||
let Item = null;
|
||||
let list = [];
|
||||
let onSubmit = e => this.onSubmit(e);
|
||||
let onSubmit = e => this.onSubmit(e);
|
||||
|
||||
const ItemAdd = (item: any) => (
|
||||
<div
|
||||
|
@ -114,7 +114,7 @@ const MenuDataviewFilterValues = observer(class MenuDataviewFilterValues extends
|
|||
/>
|
||||
</div>
|
||||
<div className="buttons">
|
||||
<Icon className="delete" onClick={e => this.onDelete(e, element)} />
|
||||
<Icon className="delete" onClick={e => this.onDelete(e, element)} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -29,8 +29,8 @@ const MenuGroupEdit = observer(class MenuGroupEdit extends React.Component<I.Men
|
|||
<MenuItemVertical
|
||||
key={i}
|
||||
{...action}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -73,7 +73,7 @@ const MenuGroupEdit = observer(class MenuGroupEdit extends React.Component<I.Men
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ const MenuGroupList = observer(class MenuGroupList extends React.Component<I.Men
|
|||
ref={node => this.node = node}
|
||||
id={'item-' + item.id}
|
||||
className={cn.join(' ')}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
style={item.style}
|
||||
>
|
||||
{allowedView ? <Handle /> : ''}
|
||||
|
|
|
@ -69,13 +69,13 @@ const MenuDataviewObjectList = observer(class MenuDataviewObjectList extends Rea
|
|||
<div className="inner" />
|
||||
</div>
|
||||
);
|
||||
} else
|
||||
} else
|
||||
if (item.isSection) {
|
||||
content = (<div className="sectionName" style={param.style}>{item.name}</div>);
|
||||
} else
|
||||
if (item.id == 'add') {
|
||||
content = (
|
||||
<div id="item-add" className="item add" onMouseEnter={e => this.onOver(e, item)} onClick={e => this.onClick(e, item)} style={param.style}>
|
||||
<div id="item-add" className="item add" onMouseEnter={e => this.onOver(e, item)} onClick={e => this.onClick(e, item)} style={param.style}>
|
||||
<Icon className="plus" />
|
||||
<div className="name">{item.name}</div>
|
||||
</div>
|
||||
|
@ -86,8 +86,8 @@ const MenuDataviewObjectList = observer(class MenuDataviewObjectList extends Rea
|
|||
id={item.id}
|
||||
object={item}
|
||||
name={name}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
caption={type ? type.name : undefined}
|
||||
style={param.style}
|
||||
/>
|
||||
|
|
|
@ -46,15 +46,15 @@ const MenuObjectValues = observer(class MenuObjectValues extends React.Component
|
|||
<div
|
||||
id={'item-' + item.id}
|
||||
className={cn.join(' ')}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
style={item.style}
|
||||
>
|
||||
<Handle />
|
||||
<span className="clickable" onClick={e => this.onClick(e, item)}>
|
||||
<span className="clickable" onClick={e => this.onClick(e, item)}>
|
||||
<IconObject object={item} />
|
||||
<ObjectName object={item} />
|
||||
</span>
|
||||
<Icon className="delete" onClick={e => this.onRemove(e, item)} />
|
||||
<Icon className="delete" onClick={e => this.onRemove(e, item)} />
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
@ -63,8 +63,8 @@ const MenuObjectValues = observer(class MenuObjectValues extends React.Component
|
|||
<div
|
||||
id="item-add"
|
||||
className="item add"
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
style={item.style}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
|
|
|
@ -149,7 +149,7 @@ const MenuRelationEdit = observer(class MenuRelationEdit extends React.Component
|
|||
<MenuItemVertical
|
||||
key={c}
|
||||
{...action}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={this.menuClose}
|
||||
/>
|
||||
))}
|
||||
|
|
|
@ -62,7 +62,7 @@ const MenuRelationList = observer(class MenuRelationList extends React.Component
|
|||
<div
|
||||
id={'item-' + item.relationKey}
|
||||
className={cn.join(' ')}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
style={item.style}
|
||||
>
|
||||
{allowedView ? <Handle /> : ''}
|
||||
|
|
|
@ -61,7 +61,7 @@ const MenuSort = observer(class MenuSort extends React.Component<I.Menu> {
|
|||
<div
|
||||
id={'item-' + item.id}
|
||||
className={[ 'item', (!allowedView ? 'isReadonly' : '') ].join(' ')}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
style={item.style}
|
||||
>
|
||||
{allowedView ? <Handle /> : ''}
|
||||
|
@ -84,8 +84,8 @@ const MenuSort = observer(class MenuSort extends React.Component<I.Menu> {
|
|||
</div>
|
||||
{allowedView ? (
|
||||
<div className="buttons">
|
||||
<Icon className="more" onClick={e => this.onClick(e, item)} />
|
||||
<Icon className="delete" onClick={e => this.onRemove(e, item)} />
|
||||
<Icon className="more" onClick={e => this.onClick(e, item)} />
|
||||
<Icon className="delete" onClick={e => this.onRemove(e, item)} />
|
||||
</div>
|
||||
) : ''}
|
||||
</div>
|
||||
|
@ -213,7 +213,7 @@ const MenuSort = observer(class MenuSort extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ const MenuSource = observer(class MenuSource extends React.Component<I.Menu> {
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ const MenuViewLayout = observer(class MenuViewLayout extends React.Component<I.M
|
|||
const Layout = (item: any) => (
|
||||
<div
|
||||
className={[ 'layout', type == item.id ? 'active' : '' ].join(' ')}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={this.menuClose}
|
||||
>
|
||||
<Icon className={item.icon} />
|
||||
|
@ -55,9 +55,9 @@ const MenuViewLayout = observer(class MenuViewLayout extends React.Component<I.M
|
|||
icon={action.icon}
|
||||
readonly={readonly}
|
||||
checkbox={(type == action.id) && (item.id == 'type')}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onMouseLeave={e => this.onMouseLeave(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onMouseLeave={e => this.onMouseLeave(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -46,16 +46,16 @@ const MenuViewList = observer(class MenuViewList extends React.Component<I.Menu>
|
|||
<div
|
||||
id={'item-' + item.id}
|
||||
className="item"
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onOver(e, item)}
|
||||
style={item.style}
|
||||
>
|
||||
{allowed ? <Handle /> : ''}
|
||||
<div className="clickable" onClick={e => loadData(item.id, 0)}>
|
||||
<div className="clickable" onClick={e => loadData(item.id, 0)}>
|
||||
<div className="name">{item.name}</div>
|
||||
</div>
|
||||
<div className="buttons">
|
||||
<Icon className="more" onClick={e => this.onViewContext(e, item)} />
|
||||
<Icon className="more" onClick={e => this.onViewContext(e, item)} />
|
||||
</div>
|
||||
</div>
|
||||
));
|
||||
|
@ -189,7 +189,7 @@ const MenuViewList = observer(class MenuViewList extends React.Component<I.Menu>
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@ const MenuViewSettings = observer(class MenuViewSettings extends React.Component
|
|||
icon={action.icon}
|
||||
readonly={readonly}
|
||||
checkbox={(type == action.id) && (item.id == 'type')}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onMouseLeave={e => this.onMouseLeave(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, action)}
|
||||
onMouseLeave={e => this.onMouseLeave(e, action)}
|
||||
onClick={e => this.onClick(e, action)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -27,8 +27,8 @@ const MenuGraphSettings = observer(class MenuGraphSettings extends React.Compone
|
|||
<MenuItemVertical
|
||||
key={i}
|
||||
{...item}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -60,7 +60,7 @@ const MenuGraphSettings = observer(class MenuGraphSettings extends React.Compone
|
|||
rebind () {
|
||||
this.unbind();
|
||||
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ class MenuHelp extends React.Component<I.Menu> {
|
|||
<MenuItemVertical
|
||||
key={i}
|
||||
{...item}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -252,7 +252,7 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> {
|
|||
};
|
||||
|
||||
const Tab = (item: any) => (
|
||||
<div className={[ 'tab', (item.id == tab ? 'active' : '') ].join(' ')} onClick={e => this.onTab(item.id)}>
|
||||
<div className={[ 'tab', (item.id == tab ? 'active' : '') ].join(' ')} onClick={e => this.onTab(item.id)}>
|
||||
{item.name}
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -558,7 +558,7 @@ class MenuQuickCapture extends React.Component<I.Menu, State> {
|
|||
const type = dbStore.getTypeById(commonStore.type);
|
||||
const data = await this.getClipboardData();
|
||||
|
||||
data.forEach(async item => {
|
||||
data.forEach(async item => {
|
||||
let text = '';
|
||||
let html = '';
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ const MenuRelationSuggest = observer(class MenuRelationSuggest extends React.Com
|
|||
<div
|
||||
id="item-add"
|
||||
className="item add"
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
style={param.style}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
|
@ -84,8 +84,8 @@ const MenuRelationSuggest = observer(class MenuRelationSuggest extends React.Com
|
|||
{...item}
|
||||
className={item.isHidden ? 'isHidden' : ''}
|
||||
style={param.style}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -226,7 +226,7 @@ const MenuSearchObject = observer(class MenuSearchObject extends React.Component
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ const MenuTypeSuggest = observer(class MenuTypeSuggest extends React.Component<I
|
|||
<div
|
||||
id="item-add"
|
||||
className="item add"
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
style={param.style}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
|
@ -84,8 +84,8 @@ const MenuTypeSuggest = observer(class MenuTypeSuggest extends React.Component<I
|
|||
{...item}
|
||||
className={item.isHidden ? 'isHidden' : ''}
|
||||
style={param.style}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
onMouseEnter={e => this.onMouseEnter(e, item)}
|
||||
onClick={e => this.onClick(e, item)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
@ -193,7 +193,7 @@ const MenuTypeSuggest = observer(class MenuTypeSuggest extends React.Component<I
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
|
|
@ -61,11 +61,11 @@ const HeadSimple = observer(class Controls extends React.Component<Props> {
|
|||
classNameWrap={item.className}
|
||||
classNameEditor={[ 'focusable', 'c' + item.id ].join(' ')}
|
||||
classNamePlaceholder={'c' + item.id}
|
||||
onFocus={e => this.onFocus(e, item)}
|
||||
onBlur={e => this.onBlur(e, item)}
|
||||
onKeyDown={e => this.onKeyDown(e, item)}
|
||||
onFocus={e => this.onFocus(e, item)}
|
||||
onBlur={e => this.onBlur(e, item)}
|
||||
onKeyDown={e => this.onKeyDown(e, item)}
|
||||
onKeyUp={() => this.onKeyUp()}
|
||||
onSelect={e => this.onSelectText(e, item)}
|
||||
onSelect={e => this.onSelectText(e, item)}
|
||||
onCompositionStart={this.onCompositionStart}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -257,7 +257,7 @@ const PageMainMedia = observer(class PageMainMedia extends React.Component<I.Pag
|
|||
return;
|
||||
};
|
||||
|
||||
C.FileDownload(block.content.targetObjectId, UtilCommon.getElectron().tmpPath, (message: any) => {
|
||||
C.FileDownload(block.content.targetObjectId, UtilCommon.getElectron().tmpPath, (message: any) => {
|
||||
if (message.path) {
|
||||
Renderer.send('pathOpen', message.path);
|
||||
};
|
||||
|
|
|
@ -123,7 +123,7 @@ const PageMainStore = observer(class PageMainStore extends React.Component<I.Pag
|
|||
<div
|
||||
key={item.id}
|
||||
className={[ 'tab', (item.id == this.view ? 'active' : '') ].join(' ')}
|
||||
onClick={e => this.onView(item.id, true)}
|
||||
onClick={e => this.onView(item.id, true)}
|
||||
>
|
||||
{item.name}
|
||||
</div>
|
||||
|
@ -150,14 +150,14 @@ const PageMainStore = observer(class PageMainStore extends React.Component<I.Pag
|
|||
if (sources.includes(item.id)) {
|
||||
icons.push({ className: 'check', tooltip: textInstalled });
|
||||
} else {
|
||||
icons.push({ className: 'plus', tooltip: textInstall, onClick: e => this.onInstall(e, item) });
|
||||
icons.push({ className: 'plus', tooltip: textInstall, onClick: e => this.onInstall(e, item) });
|
||||
};
|
||||
break;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={cn.join(' ')}>
|
||||
<div className="flex" onClick={e => this.onClick(e, item)}>
|
||||
<div className="flex" onClick={e => this.onClick(e, item)}>
|
||||
<IconObject iconSize={iconSize} object={item} />
|
||||
<div className="name">{item.name}</div>
|
||||
</div>
|
||||
|
|
|
@ -250,7 +250,7 @@ const PopupSearch = observer(class PopupSearch extends React.Component<I.Popup,
|
|||
|
||||
const win = $(window);
|
||||
win.on('keydown.search', e => this.onKeyDown(e));
|
||||
win.on('resize.search', e => this.resize());
|
||||
win.on('resize.search', e => this.resize());
|
||||
};
|
||||
|
||||
unbind () {
|
||||
|
|
|
@ -225,7 +225,7 @@ const PopupSettings = observer(class PopupSettings extends React.Component<I.Pop
|
|||
this.unbind();
|
||||
win.on('resize.settings', () => this.resize());
|
||||
win.on('keydown.settings', e => this.onKeyDown(e));
|
||||
win.on('mousedown.settings', e => this.onMouseDown(e));
|
||||
win.on('mousedown.settings', e => this.onMouseDown(e));
|
||||
};
|
||||
|
||||
unbind () {
|
||||
|
|
|
@ -161,8 +161,8 @@ const SelectionProvider = observer(class SelectionProvider extends React.Compone
|
|||
scrollOnMove.onMouseDown(e, isPopup);
|
||||
this.unbindMouse();
|
||||
|
||||
win.on(`mousemove.selection`, e => this.onMouseMove(e));
|
||||
win.on(`blur.selection mouseup.selection`, e => this.onMouseUp(e));
|
||||
win.on(`mousemove.selection`, e => this.onMouseMove(e));
|
||||
win.on(`blur.selection mouseup.selection`, e => this.onMouseUp(e));
|
||||
};
|
||||
|
||||
initNodes () {
|
||||
|
|
|
@ -98,8 +98,8 @@ const Progress = observer(class Progress extends React.Component {
|
|||
keyboard.setDragging(true);
|
||||
|
||||
win.off('mousemove.progress mouseup.progress');
|
||||
win.on('mousemove.progress', e => this.onDragMove(e));
|
||||
win.on('mouseup.progress', e => this.onDragEnd(e));
|
||||
win.on('mousemove.progress', e => this.onDragMove(e));
|
||||
win.on('mouseup.progress', e => this.onDragEnd(e));
|
||||
};
|
||||
|
||||
onDragMove (e: any) {
|
||||
|
|
|
@ -279,7 +279,7 @@ const WidgetTree = observer(class WidgetTree extends React.Component<I.WidgetCom
|
|||
};
|
||||
|
||||
// return the child nodes details for the given subId
|
||||
getChildNodesDetails (nodeId: string): I.WidgetTreeDetails[] {
|
||||
getChildNodesDetails (nodeId: string): I.WidgetTreeDetails[] {
|
||||
const subId = this.getSubId(nodeId);
|
||||
|
||||
return dbStore.getRecords(subId, '').map(id => this.mapper(detailStore.get(subId, id, [ 'id', 'layout', 'links' ], true)));
|
||||
|
|
|
@ -134,8 +134,8 @@ class BlockStore {
|
|||
|
||||
updateStructure (rootId: string, blockId: string, childrenIds: string[]) {
|
||||
const map = this.getMap(rootId);
|
||||
const element = this.getMapElement(rootId, blockId);
|
||||
|
||||
let element = this.getMapElement(rootId, blockId);
|
||||
if (!element) {
|
||||
map.set(blockId, new M.BlockStructure({ parentId: '', childrenIds }));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue