mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
remove double space
This commit is contained in:
parent
5361146227
commit
41dc507422
66 changed files with 100 additions and 100 deletions
2
dist/workers/graph.js
vendored
2
dist/workers/graph.js
vendored
|
@ -141,7 +141,7 @@ initFonts = () => {
|
|||
const fontFace = new FontFace(name, `url("../font/inter/regular.woff2") format("woff2")`);
|
||||
|
||||
self.fonts.add(fontFace);
|
||||
fontFace.load().then(() => fontFamily = name);
|
||||
fontFace.load().then(() => fontFamily = name);
|
||||
};
|
||||
|
||||
image = ({ src, bitmap }) => {
|
||||
|
|
|
@ -114,7 +114,7 @@ function createWindow () {
|
|||
|
||||
if (mainWindow.isFullScreen()) {
|
||||
mainWindow.setFullScreen(false);
|
||||
mainWindow.once('leave-full-screen', () => mainWindow.hide());
|
||||
mainWindow.once('leave-full-screen', () => mainWindow.hide());
|
||||
} else {
|
||||
mainWindow.hide();
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@ $(() => {
|
|||
copyIcon.addClass('active');
|
||||
|
||||
clearTimeout(timeout);
|
||||
setTimeout(() => copyIcon.removeClass('active'), 2000);
|
||||
setTimeout(() => copyIcon.removeClass('active'), 2000);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
|
|
|
@ -182,7 +182,7 @@ class Api {
|
|||
Util.log('info', '[Api].exit, relaunch: ' + relaunch);
|
||||
Util.send(win, 'shutdownStart');
|
||||
|
||||
Server.stop(signal).then(() => this.shutdown(win, relaunch));
|
||||
Server.stop(signal).then(() => this.shutdown(win, relaunch));
|
||||
};
|
||||
|
||||
setInterfaceLang (win, lang) {
|
||||
|
|
|
@ -230,7 +230,7 @@ class MenuManager {
|
|||
|
||||
{ label: 'Export templates', click: () => Util.send(this.win, 'commandGlobal', 'exportTemplates') },
|
||||
{ label: 'Export objects', click: () => Util.send(this.win, 'commandGlobal', 'exportObjects') },
|
||||
{ label: 'Export localstore', click: () => Util.send(this.win, 'commandGlobal', 'exportLocalstore') },
|
||||
{ label: 'Export localstore', click: () => Util.send(this.win, 'commandGlobal', 'exportLocalstore') },
|
||||
|
||||
Separator,
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class WindowManager {
|
|||
win = null;
|
||||
});
|
||||
|
||||
win.once('ready-to-show', () => win.show());
|
||||
win.once('ready-to-show', () => win.show());
|
||||
win.on('focus', () => {
|
||||
UpdateManager.setWindow(win);
|
||||
MenuManager.setWindow(win);
|
||||
|
|
|
@ -334,9 +334,9 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
|
|||
horizontal: I.MenuDirection.Center,
|
||||
commonFilter: true,
|
||||
onOpen: () => {
|
||||
window.setTimeout(() => $(element).addClass('isFocused'));
|
||||
window.setTimeout(() => $(element).addClass('isFocused'));
|
||||
},
|
||||
onClose: () => $(element).removeClass('isFocused'),
|
||||
onClose: () => $(element).removeClass('isFocused'),
|
||||
data: {
|
||||
canAdd: true,
|
||||
filter: '',
|
||||
|
|
|
@ -424,7 +424,7 @@ class App extends React.Component<object, State> {
|
|||
popupStore.closeAll();
|
||||
};
|
||||
|
||||
window.setTimeout(() => popupStore.open(id, param), Constant.delay.popup);
|
||||
window.setTimeout(() => popupStore.open(id, param), Constant.delay.popup);
|
||||
};
|
||||
|
||||
onUpdateCheck (e: any, auto: boolean) {
|
||||
|
|
|
@ -961,7 +961,7 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props
|
|||
};
|
||||
|
||||
if (message.views && message.views.length) {
|
||||
window.setTimeout(() => this.loadData(message.views[0].id, 0, true), 50);
|
||||
window.setTimeout(() => this.loadData(message.views[0].id, 0, true), 50);
|
||||
};
|
||||
|
||||
if (isNew) {
|
||||
|
@ -1201,7 +1201,7 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props
|
|||
block.content.objectOrder.push(it);
|
||||
};
|
||||
|
||||
window.setTimeout(() => this.applyObjectOrder(it.groupId, records), 30);
|
||||
window.setTimeout(() => this.applyObjectOrder(it.groupId, records), 30);
|
||||
});
|
||||
|
||||
if (callBack) {
|
||||
|
|
|
@ -427,7 +427,7 @@ const Cell = observer(class Cell extends React.Component<Props> {
|
|||
});
|
||||
|
||||
if (!config.debug.ui) {
|
||||
win.off('blur.cell').on('blur.cell', () => menuStore.closeAll(Constant.menuIds.cell));
|
||||
win.off('blur.cell').on('blur.cell', () => menuStore.closeAll(Constant.menuIds.cell));
|
||||
};
|
||||
} else
|
||||
if (closeIfOpen) {
|
||||
|
|
|
@ -171,7 +171,7 @@ const CellObject = observer(class CellObject extends React.Component<I.Cell, Sta
|
|||
this.setState({ isEditing: v });
|
||||
|
||||
if (v) {
|
||||
window.setTimeout(() => this.focus(), 15);
|
||||
window.setTimeout(() => this.focus(), 15);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -91,7 +91,7 @@ const CellSelect = observer(class CellSelect extends React.Component<I.Cell, Sta
|
|||
color={item.color}
|
||||
canEdit={!isSelect}
|
||||
className={Relation.selectClassName(relation.format)}
|
||||
onRemove={() => this.onValueRemove(item.id)}
|
||||
onRemove={() => this.onValueRemove(item.id)}
|
||||
/>
|
||||
</span>
|
||||
))}
|
||||
|
|
|
@ -105,7 +105,7 @@ const Card = observer(class Card extends React.Component<Props> {
|
|||
0: () => {
|
||||
keyboard.withCommand(e) ? UtilObject.openWindow(record) : UtilObject.openPopup(record);
|
||||
},
|
||||
2: () => onContext(e, record.id)
|
||||
2: () => onContext(e, record.id)
|
||||
};
|
||||
|
||||
const ids = selection ? selection.get(I.SelectType.Record) : [];
|
||||
|
|
|
@ -247,7 +247,7 @@ const Column = observer(class Column extends React.Component<Props> {
|
|||
menuStore.open('dataviewGroupEdit', {
|
||||
element: `#column-${id}-head`,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
onClose: () => node.removeClass('active'),
|
||||
onClose: () => node.removeClass('active'),
|
||||
data: {
|
||||
rootId,
|
||||
blockId: block.id,
|
||||
|
|
|
@ -154,7 +154,7 @@ const Card = observer(class Card extends React.Component<Props> {
|
|||
0: () => {
|
||||
keyboard.withCommand(e) ? UtilObject.openWindow(record) : UtilObject.openPopup(record);
|
||||
},
|
||||
2: () => onContext(e, record.id)
|
||||
2: () => onContext(e, record.id)
|
||||
};
|
||||
|
||||
const ids = selection ? selection.get(I.SelectType.Record) : [];
|
||||
|
|
|
@ -168,7 +168,7 @@ const ViewGrid = observer(class ViewGrid extends React.Component<I.ViewComponent
|
|||
const node = $(this.node);
|
||||
|
||||
this.unbind();
|
||||
node.find('#scroll').on('scroll', () => this.onScroll());
|
||||
node.find('#scroll').on('scroll', () => this.onScroll());
|
||||
};
|
||||
|
||||
unbind () {
|
||||
|
@ -296,7 +296,7 @@ const ViewGrid = observer(class ViewGrid extends React.Component<I.ViewComponent
|
|||
width: this.checkWidth(e.pageX - this.ox),
|
||||
});
|
||||
|
||||
window.setTimeout(() => keyboard.setResize(false), 50);
|
||||
window.setTimeout(() => keyboard.setResize(false), 50);
|
||||
};
|
||||
|
||||
checkWidth (width: number): number {
|
||||
|
@ -319,7 +319,7 @@ const ViewGrid = observer(class ViewGrid extends React.Component<I.ViewComponent
|
|||
isInline,
|
||||
isCollection,
|
||||
blockId: block.id,
|
||||
onAdd: () => menuStore.closeAll(Constant.menuIds.cellAdd)
|
||||
onAdd: () => menuStore.closeAll(Constant.menuIds.cellAdd)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -88,8 +88,8 @@ const HeadCell = observer(class HeadCell extends React.Component<Props> {
|
|||
element,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
noFlipY: true,
|
||||
onOpen: () => obj.addClass('active'),
|
||||
onClose: () => obj.removeClass('active'),
|
||||
onOpen: () => obj.addClass('active'),
|
||||
onClose: () => obj.removeClass('active'),
|
||||
data: {
|
||||
loadData,
|
||||
getView,
|
||||
|
|
|
@ -125,7 +125,7 @@ const Row = observer(class Row extends React.Component<Props> {
|
|||
0: () => {
|
||||
keyboard.withCommand(e) ? UtilObject.openWindow(record) : UtilObject.openPopup(record);
|
||||
},
|
||||
2: () => onContext(e, record.id)
|
||||
2: () => onContext(e, record.id)
|
||||
};
|
||||
|
||||
const ids = selection ? selection.get(I.SelectType.Record) : [];
|
||||
|
|
|
@ -657,7 +657,7 @@ const BlockFeatured = observer(class BlockFeatured extends React.Component<Props
|
|||
param.classNameWrap = 'fixed fromHeader';
|
||||
};
|
||||
|
||||
menuStore.closeAll(null, () => menuStore.open('blockRelationView', param));
|
||||
menuStore.closeAll(null, () => menuStore.open('blockRelationView', param));
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -264,7 +264,7 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
component: 'select',
|
||||
onOpen: (context: any) => {
|
||||
menuContext = context;
|
||||
raf(() => this.onOptionsOpen(type, rowId, columnId, cellId));
|
||||
raf(() => this.onOptionsOpen(type, rowId, columnId, cellId));
|
||||
},
|
||||
onClose: () => {
|
||||
menuStore.closeAll(Constant.menuIds.table);
|
||||
|
@ -432,7 +432,7 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
options: this.optionsHAlign(),
|
||||
value: current.hAlign,
|
||||
onSelect: (e: any, el: any) => {
|
||||
fill(() => C.BlockListSetAlign(rootId, blockIds, el.id));
|
||||
fill(() => C.BlockListSetAlign(rootId, blockIds, el.id));
|
||||
menuContext.close();
|
||||
}
|
||||
});
|
||||
|
@ -446,7 +446,7 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
options: this.optionsVAlign(),
|
||||
value: current.vAlign,
|
||||
onSelect: (e: any, el: any) => {
|
||||
fill(() => C.BlockListSetVerticalAlign(rootId, blockIds, el.id));
|
||||
fill(() => C.BlockListSetVerticalAlign(rootId, blockIds, el.id));
|
||||
menuContext.close();
|
||||
}
|
||||
});
|
||||
|
@ -457,7 +457,7 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
menuId = 'blockColor';
|
||||
menuParam.data = Object.assign(menuParam.data, {
|
||||
onChange: (id: string) => {
|
||||
fill(() => C.BlockTextListSetColor(rootId, blockIds, id));
|
||||
fill(() => C.BlockTextListSetColor(rootId, blockIds, id));
|
||||
menuContext.close();
|
||||
}
|
||||
});
|
||||
|
@ -468,7 +468,7 @@ const BlockTable = observer(class BlockTable extends React.Component<I.BlockComp
|
|||
menuId = 'blockBackground';
|
||||
menuParam.data = Object.assign(menuParam.data, {
|
||||
onChange: (id: string) => {
|
||||
fill(() => C.BlockListSetBackgroundColor(rootId, blockIds, id));
|
||||
fill(() => C.BlockListSetBackgroundColor(rootId, blockIds, id));
|
||||
menuContext.close();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -144,7 +144,7 @@ const BlockTableCell = observer(class BlockTableCell extends React.Component<Pro
|
|||
onKeyUp={(e: any, text: string, marks: I.Mark[], range: I.TextRange, props: any) => {
|
||||
onCellKeyUp(e, row.id, column.id, cellId, text, marks, range, props);
|
||||
}}
|
||||
onUpdate={() => onCellUpdate(cellId)}
|
||||
onUpdate={() => onCellUpdate(cellId)}
|
||||
onFocus={e => onCellFocus(e, row.id, column.id, cellId)}
|
||||
onBlur={e => onCellBlur(e, row.id, column.id, cellId)}
|
||||
getWrapperWidth={() => Constant.size.editor}
|
||||
|
|
|
@ -1429,7 +1429,7 @@ const BlockText = observer(class BlockText extends React.Component<Props> {
|
|||
|
||||
onMouseUp () {
|
||||
window.clearTimeout(this.timeoutClick);
|
||||
this.timeoutClick = window.setTimeout(() => this.clicks = 0, 300);
|
||||
this.timeoutClick = window.setTimeout(() => this.clicks = 0, 300);
|
||||
};
|
||||
|
||||
onSelectIcon (icon: string) {
|
||||
|
|
|
@ -186,7 +186,7 @@ const BlockType = observer(class BlockType extends React.Component<I.BlockCompon
|
|||
|
||||
menuStore.open('typeSuggest', {
|
||||
element: `#block-${block.id} #item-menu`,
|
||||
onOpen: () => obj.addClass('active'),
|
||||
onOpen: () => obj.addClass('active'),
|
||||
onClose: () => {
|
||||
obj.removeClass('active');
|
||||
focus.apply();
|
||||
|
|
|
@ -628,7 +628,7 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
|
|||
};
|
||||
|
||||
e.preventDefault();
|
||||
Action.duplicate(rootId, rootId, ids[ids.length - 1], ids, I.BlockPosition.Bottom, () => focus.clear(true));
|
||||
Action.duplicate(rootId, rootId, ids[ids.length - 1], ids, I.BlockPosition.Bottom, () => focus.clear(true));
|
||||
});
|
||||
|
||||
for (const item of styleParam) {
|
||||
|
@ -1329,7 +1329,7 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
|
|||
};
|
||||
|
||||
Action.move(rootId, rootId, obj.id, [ block.id ], (isShift ? I.BlockPosition.Bottom : I.BlockPosition.Inner), () => {
|
||||
window.setTimeout(() => this.focus(block.id, range.from, range.to, false), 50);
|
||||
window.setTimeout(() => this.focus(block.id, range.from, range.to, false), 50);
|
||||
|
||||
if (next && next.isTextToggle()) {
|
||||
blockStore.toggle(rootId, next.id, true);
|
||||
|
@ -1880,7 +1880,7 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
|
|||
|
||||
C.BlockCreate(rootId, blockId, position, param, (message: any) => {
|
||||
if (param.type == I.BlockType.Text) {
|
||||
window.setTimeout(() => this.focus(message.blockId, 0, 0, false), 15);
|
||||
window.setTimeout(() => this.focus(message.blockId, 0, 0, false), 15);
|
||||
};
|
||||
|
||||
if (callBack) {
|
||||
|
|
|
@ -116,7 +116,7 @@ class Header extends React.Component<Props> {
|
|||
menuParam.classNameWrap = 'fixed fromHeader';
|
||||
};
|
||||
|
||||
menuStore.closeAllForced(null, () => menuStore.open(id, menuParam));
|
||||
menuStore.closeAllForced(null, () => menuStore.open(id, menuParam));
|
||||
};
|
||||
|
||||
getContainer () {
|
||||
|
|
|
@ -116,7 +116,7 @@ const HeaderMainObject = observer(class HeaderMainObject extends React.Component
|
|||
const object = detailStore.get(rootId, rootId, []);
|
||||
|
||||
keyboard.disableClose(true);
|
||||
popupStore.closeAll(null, () => UtilObject.openRoute(object));
|
||||
popupStore.closeAll(null, () => UtilObject.openRoute(object));
|
||||
};
|
||||
|
||||
onMore () {
|
||||
|
|
|
@ -99,7 +99,7 @@ class MenuBlockAction extends React.Component<I.Menu, State> {
|
|||
this._isMounted = true;
|
||||
this.rebind();
|
||||
|
||||
menu.off('mouseleave').on('mouseleave', () => menuStore.clearTimeout());
|
||||
menu.off('mouseleave').on('mouseleave', () => menuStore.clearTimeout());
|
||||
};
|
||||
|
||||
componentDidUpdate () {
|
||||
|
@ -513,7 +513,7 @@ class MenuBlockAction extends React.Component<I.Menu, State> {
|
|||
{ operator: I.FilterOperator.And, relationKey: 'layout', condition: I.FilterCondition.In, value: UtilObject.getPageLayouts() },
|
||||
],
|
||||
canAdd: true,
|
||||
onSelect: () => close()
|
||||
onSelect: () => close()
|
||||
});
|
||||
break;
|
||||
};
|
||||
|
|
|
@ -207,7 +207,7 @@ const MenuBlockAdd = observer(class MenuBlockAdd extends React.Component<I.Menu>
|
|||
keyMapper: i => (items[i] || {}).id,
|
||||
});
|
||||
|
||||
$(`#${getId()}`).off('mouseleave').on('mouseleave', () => window.clearTimeout(this.timeout));
|
||||
$(`#${getId()}`).off('mouseleave').on('mouseleave', () => window.clearTimeout(this.timeout));
|
||||
};
|
||||
|
||||
componentDidUpdate () {
|
||||
|
|
|
@ -256,7 +256,7 @@ const MenuBlockContext = observer(class MenuBlockContext extends React.Component
|
|||
menuStore.updateData(this.props.id, { marks });
|
||||
onChange(marks);
|
||||
|
||||
window.setTimeout(() => focus.apply(), 15);
|
||||
window.setTimeout(() => focus.apply(), 15);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ const MenuBlockCover = observer(class MenuBlockCover extends React.Component<I.M
|
|||
<div
|
||||
key={item.id}
|
||||
className={[ 'btn', (item.id == this.tab ? 'active' : '') ].join(' ')}
|
||||
onClick={() => this.setTab(item.id)}
|
||||
onClick={() => this.setTab(item.id)}
|
||||
>
|
||||
{item.name}
|
||||
</div>
|
||||
|
|
|
@ -508,7 +508,7 @@ class MenuBlockMore extends React.Component<I.Menu> {
|
|||
};
|
||||
|
||||
case 'pageUninstall': {
|
||||
Action.uninstall(object, false, () => onBack());
|
||||
Action.uninstall(object, false, () => onBack());
|
||||
break;
|
||||
};
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ const MenuBlockRelationView = observer(class MenuBlockRelationView extends React
|
|||
if (idx < 0) {
|
||||
const item = items.find(it => it.relationKey == relationKey);
|
||||
const cb = () => {
|
||||
C.ObjectRelationAddFeatured(rootId, [ relationKey ], () => analytics.event('FeatureRelation'));
|
||||
C.ObjectRelationAddFeatured(rootId, [ relationKey ], () => analytics.event('FeatureRelation'));
|
||||
};
|
||||
|
||||
if (item.scope == I.RelationScope.Type) {
|
||||
|
@ -228,7 +228,7 @@ const MenuBlockRelationView = observer(class MenuBlockRelationView extends React
|
|||
cb();
|
||||
};
|
||||
} else {
|
||||
C.ObjectRelationRemoveFeatured(rootId, [ relationKey ], () => analytics.event('UnfeatureRelation'));
|
||||
C.ObjectRelationRemoveFeatured(rootId, [ relationKey ], () => analytics.event('UnfeatureRelation'));
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ const MenuDataviewFileValues = observer(class MenuDataviewFileValues extends Rea
|
|||
);
|
||||
|
||||
const Image = (item: any) => (
|
||||
<img src={commonStore.imageUrl(item.id, 208)} className="img" onLoad={() => position()} />
|
||||
<img src={commonStore.imageUrl(item.id, 208)} className="img" onLoad={() => position()} />
|
||||
);
|
||||
|
||||
const Item = SortableElement((item: any) => {
|
||||
|
|
|
@ -139,7 +139,7 @@ const MenuFilterList = observer(class MenuFilterList extends React.Component<I.M
|
|||
className="item add"
|
||||
onClick={this.onAdd}
|
||||
onMouseEnter={() => { this.props.setHover({ id: 'add' }); }}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
<div className="name">{translate('menuDataviewFilterNewFilter')}</div>
|
||||
|
@ -182,7 +182,7 @@ const MenuFilterList = observer(class MenuFilterList extends React.Component<I.M
|
|||
const { getId } = this.props;
|
||||
const obj = $(`#${getId()} .content`);
|
||||
|
||||
obj.off('click').on('click', () => menuStore.closeAll(Constant.menuIds.cell));
|
||||
obj.off('click').on('click', () => menuStore.closeAll(Constant.menuIds.cell));
|
||||
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.props.onKeyDown(e));
|
||||
|
@ -286,7 +286,7 @@ const MenuFilterList = observer(class MenuFilterList extends React.Component<I.M
|
|||
const { oldIndex, newIndex } = result;
|
||||
|
||||
view.filters = arrayMove(view.filters as I.Filter[], oldIndex, newIndex);
|
||||
C.BlockDataviewFilterSort(rootId, blockId, view.id, view.filters.map(it => it.id), () => loadData(view.id, 0));
|
||||
C.BlockDataviewFilterSort(rootId, blockId, view.id, view.filters.map(it => it.id), () => loadData(view.id, 0));
|
||||
|
||||
keyboard.disableSelection(false);
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ const MenuOptionList = observer(class MenuOptionList extends React.Component<I.M
|
|||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('keydown.menu', e => this.onKeyDown(e));
|
||||
$(`#${this.props.getId()}`).on('click', () => menuStore.close('dataviewOptionEdit'));
|
||||
$(`#${this.props.getId()}`).on('click', () => menuStore.close('dataviewOptionEdit'));
|
||||
window.setTimeout(() => this.props.setActive(), 15);
|
||||
};
|
||||
|
||||
|
@ -316,7 +316,7 @@ const MenuOptionList = observer(class MenuOptionList extends React.Component<I.M
|
|||
this.onFilterChange('');
|
||||
this.onValueAdd(message.objectId);
|
||||
|
||||
window.setTimeout(() => this.resize(), 50);
|
||||
window.setTimeout(() => this.resize(), 50);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ const MenuRelationList = observer(class MenuRelationList extends React.Component
|
|||
className="item add"
|
||||
onClick={this.onAdd}
|
||||
onMouseEnter={() => { this.props.setHover({ id: 'add' }); }}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
<div className="name">{translate('menuDataviewRelationListAddRelation')}</div>
|
||||
|
|
|
@ -172,7 +172,7 @@ const MenuSort = observer(class MenuSort extends React.Component<I.Menu> {
|
|||
className="item add"
|
||||
onClick={this.onAdd}
|
||||
onMouseEnter={() => { this.props.setHover({ id: 'add' }); }}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
<div className="name">{translate('menuDataviewSortNewSort')}</div>
|
||||
|
|
|
@ -146,7 +146,7 @@ const MenuViewList = observer(class MenuViewList extends React.Component<I.Menu>
|
|||
className="item add"
|
||||
onClick={this.onAdd}
|
||||
onMouseEnter={() => { this.props.setHover({ id: 'add' }); }}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
onMouseLeave={() => this.props.setHover()}
|
||||
>
|
||||
<Icon className="plus" />
|
||||
<div className="name">{translate('menuDataviewViewListAddView')}</div>
|
||||
|
|
|
@ -605,7 +605,7 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> {
|
|||
});
|
||||
|
||||
window.clearTimeout(this.timeoutPoly);
|
||||
this.timeoutPoly = window.setTimeout(() => this.poly.hide(), 500);
|
||||
this.timeoutPoly = window.setTimeout(() => this.poly.hide(), 500);
|
||||
};
|
||||
|
||||
// Arrow positioning
|
||||
|
@ -708,7 +708,7 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> {
|
|||
|
||||
if (refInput) {
|
||||
if (refInput.isFocused && (this.ref.n < 0)) {
|
||||
keyboard.shortcut('arrowleft, arrowright', e, () => ret = true);
|
||||
keyboard.shortcut('arrowleft, arrowright', e, () => ret = true);
|
||||
|
||||
keyboard.shortcut('arrowdown', e, () => {
|
||||
refInput.blur();
|
||||
|
|
|
@ -49,9 +49,9 @@ class MenuSearchText extends React.Component<I.Menu> {
|
|||
<div className="buttons">
|
||||
|
||||
<div id="switcher" className="switcher">
|
||||
<Icon className="arrow left" onClick={() => this.onArrow(-1)} />
|
||||
<Icon className="arrow left" onClick={() => this.onArrow(-1)} />
|
||||
<div id="cnt" className="cnt" />
|
||||
<Icon className="arrow right" onClick={() => this.onArrow(1)} />
|
||||
<Icon className="arrow right" onClick={() => this.onArrow(1)} />
|
||||
</div>
|
||||
|
||||
<div className="line" />
|
||||
|
|
|
@ -191,7 +191,7 @@ const MenuSelect = observer(class MenuSelect extends React.Component<I.Menu> {
|
|||
};
|
||||
|
||||
if (active && !active.isInitial) {
|
||||
window.setTimeout(() => setActive(active, true), 15);
|
||||
window.setTimeout(() => setActive(active, true), 15);
|
||||
};
|
||||
|
||||
this.resize();
|
||||
|
|
|
@ -56,7 +56,7 @@ const PageAuthPinCheck = observer(class PageAuthPinCheck extends React.Component
|
|||
|
||||
rebind () {
|
||||
this.unbind();
|
||||
$(window).on('focus.pin', () => this.ref.focus());
|
||||
$(window).on('focus.pin', () => this.ref.focus());
|
||||
};
|
||||
|
||||
onError () {
|
||||
|
|
|
@ -151,7 +151,7 @@ const ControlButtons = observer(class ControlButtons extends React.Component<Pro
|
|||
onOpen: onCoverOpen,
|
||||
onClose: () => {
|
||||
window.clearTimeout(this.timeout);
|
||||
this.timeout = window.setTimeout(() => onCoverClose(), Constant.delay.menu);
|
||||
this.timeout = window.setTimeout(() => onCoverClose(), Constant.delay.menu);
|
||||
},
|
||||
data: {
|
||||
options: options,
|
||||
|
|
|
@ -64,7 +64,7 @@ const HeadSimple = observer(class Controls extends React.Component<Props> {
|
|||
onFocus={e => this.onFocus(e, item)}
|
||||
onBlur={e => this.onBlur(e, item)}
|
||||
onKeyDown={e => this.onKeyDown(e, item)}
|
||||
onKeyUp={() => this.onKeyUp()}
|
||||
onKeyUp={() => this.onKeyUp()}
|
||||
onSelect={e => this.onSelectText(e, item)}
|
||||
onCompositionStart={this.onCompositionStart}
|
||||
/>
|
||||
|
@ -169,7 +169,7 @@ const HeadSimple = observer(class Controls extends React.Component<Props> {
|
|||
focus.set('title', { from: 0, to: 0 });
|
||||
};
|
||||
|
||||
window.setTimeout(() => focus.apply(), 10);
|
||||
window.setTimeout(() => focus.apply(), 10);
|
||||
};
|
||||
|
||||
onFocus (e: any, item: any) {
|
||||
|
|
|
@ -74,7 +74,7 @@ const PageMainGraph = observer(class PageMainGraph extends React.Component<I.Pag
|
|||
|
||||
if (this.loading) {
|
||||
window.clearTimeout(this.timeoutLoading);
|
||||
this.timeoutLoading = window.setTimeout(() => this.setLoading(false), 100);
|
||||
this.timeoutLoading = window.setTimeout(() => this.setLoading(false), 100);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -167,7 +167,7 @@ const PageMainGraph = observer(class PageMainGraph extends React.Component<I.Pag
|
|||
loader.show().css({ opacity: 1 });
|
||||
} else {
|
||||
loader.css({ opacity: 0 });
|
||||
window.setTimeout(() => loader.hide(), 200);
|
||||
window.setTimeout(() => loader.hide(), 200);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -322,7 +322,7 @@ const PageMainHistory = observer(class PageMainHistory extends React.Component<I
|
|||
children.css({ overflow: 'hidden', height: height });
|
||||
|
||||
window.setTimeout(() => { children.css({ height: 0 }); }, 15);
|
||||
window.setTimeout(() => children.hide(), 215);
|
||||
window.setTimeout(() => children.hide(), 215);
|
||||
} else {
|
||||
item.addClass('expanded');
|
||||
children.show();
|
||||
|
|
|
@ -117,7 +117,7 @@ const PageMainNavigation = observer(class PageMainNavigation extends React.Compo
|
|||
|
||||
<div className="buttons">
|
||||
<Button text={translate('popupNavigationOpen')} className="c36" onClick={e => this.onConfirm(e, item)} />
|
||||
{isPopup ? <Button text={translate('popupNavigationCancel')} className="c36" color="blank" onClick={() => popupStore.close('page')} /> : ''}
|
||||
{isPopup ? <Button text={translate('popupNavigationCancel')} className="c36" color="blank" onClick={() => popupStore.close('page')} /> : ''}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -27,7 +27,7 @@ const PopupSettingsPageAppearance = observer(class PopupSettingsPageAppearance e
|
|||
<div
|
||||
key={i}
|
||||
className={[ 'btn', (theme == item.id ? 'active' : ''), item.class ].join(' ')}
|
||||
onClick={() => this.onTheme(item.id)}
|
||||
onClick={() => this.onTheme(item.id)}
|
||||
>
|
||||
<div className="bg">
|
||||
<Icon />
|
||||
|
|
|
@ -56,7 +56,7 @@ const PopupSettingsPageDataManagement = observer(class PopupSettingsPageStorageI
|
|||
|
||||
<Title className="sub" text={translate('popupSettingsDataManagementDeleteTitle')} />
|
||||
<Label className="description" text={translate('popupSettingsDataManagementDeleteText')} />
|
||||
<Button className="c36" onClick={() => onPage('delete')} color="red" text={translate('popupSettingsDataManagementDeleteButton')} />
|
||||
<Button className="c36" onClick={() => onPage('delete')} color="red" text={translate('popupSettingsDataManagementDeleteButton')} />
|
||||
|
||||
</React.Fragment>
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@ class PopupSettingsHead extends React.Component<Props> {
|
|||
return (
|
||||
<div className="head">
|
||||
<div className="inner">
|
||||
<div className="element" onClick={() => onPage(returnTo || prevPage)}>
|
||||
<div className="element" onClick={() => onPage(returnTo || prevPage)}>
|
||||
<Icon className="back" />
|
||||
{name}
|
||||
</div>
|
||||
|
|
|
@ -17,7 +17,7 @@ const PopupSettingsPageImportIndex = observer(class PopupSettingsPageImportIndex
|
|||
|
||||
const Item = (item: any) => {
|
||||
return (
|
||||
<div className={[ 'item', item.id ].join(' ')} onClick={() => this.onClick(item.id)} >
|
||||
<div className={[ 'item', item.id ].join(' ')} onClick={() => this.onClick(item.id)} >
|
||||
<Icon className={`import-${item.id}`} />
|
||||
<div className="name">{item.name}</div>
|
||||
</div>
|
||||
|
|
|
@ -50,7 +50,7 @@ class PopupSettingsPageImportNotion extends React.Component<I.PopupSettings, Sta
|
|||
|
||||
<div className="helpWrapper flex">
|
||||
<Title text={translate('popupSettingsImportNotionHowTo')} />
|
||||
<div className="btn" onClick={() => onPage('importNotionHelp')}>
|
||||
<div className="btn" onClick={() => onPage('importNotionHelp')}>
|
||||
<Icon className="help" />{translate('popupSettingsImportNotionStepByStepGuide')}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -569,7 +569,7 @@ const PopupSearch = observer(class PopupSearch extends React.Component<I.Popup,
|
|||
|
||||
case 'relation': {
|
||||
$('#button-header-relation').trigger('click');
|
||||
window.setTimeout(() => $('#menuBlockRelationView #item-add').trigger('click'), Constant.delay.menu * 2);
|
||||
window.setTimeout(() => $('#menuBlockRelationView #item-add').trigger('click'), Constant.delay.menu * 2);
|
||||
break;
|
||||
};
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ const PopupSettings = observer(class PopupSettings extends React.Component<I.Pop
|
|||
const win = $(window);
|
||||
|
||||
this.unbind();
|
||||
win.on('resize.settings', () => this.resize());
|
||||
win.on('resize.settings', () => this.resize());
|
||||
win.on('keydown.settings', e => this.onKeyDown(e));
|
||||
win.on('mousedown.settings', e => this.onMouseDown(e));
|
||||
};
|
||||
|
|
|
@ -142,7 +142,7 @@ const PreviewComponent = observer(class PreviewComponent extends React.Component
|
|||
menuStore.open('blockLink', {
|
||||
rect: rect ? { ...rect, height: 0, y: rect.y + win.scrollTop() } : null,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
onOpen: () => Preview.previewHide(true),
|
||||
onOpen: () => Preview.previewHide(true),
|
||||
data: {
|
||||
filter: mark ? mark.param : '',
|
||||
type: mark ? mark.type : null,
|
||||
|
|
|
@ -234,7 +234,7 @@ const Sidebar = observer(class Sidebar extends React.Component<Props> {
|
|||
$('body').removeClass('rowResize colResize');
|
||||
$(window).off('mousemove.sidebar mouseup.sidebar');
|
||||
|
||||
window.setTimeout(() => this.movedX = false, 15);
|
||||
window.setTimeout(() => this.movedX = false, 15);
|
||||
};
|
||||
|
||||
onHandleClick () {
|
||||
|
|
|
@ -38,7 +38,7 @@ class Frame extends React.Component<Props> {
|
|||
this.resize();
|
||||
this.unbind();
|
||||
|
||||
$(window).on('resize.frame', () => this.resize());
|
||||
$(window).on('resize.frame', () => this.resize());
|
||||
};
|
||||
|
||||
componentWillUnmount () {
|
||||
|
|
|
@ -100,9 +100,9 @@ class MediaAudio extends React.Component<Props> {
|
|||
this.audioNode = el.get(0) as HTMLAudioElement;
|
||||
|
||||
if (el.length) {
|
||||
el.on('canplay timeupdate', () => this.onTimeUpdate());
|
||||
el.on('play', () => this.onPlay());
|
||||
el.on('ended pause', () => this.onPause());
|
||||
el.on('canplay timeupdate', () => this.onTimeUpdate());
|
||||
el.on('play', () => this.onPlay());
|
||||
el.on('ended pause', () => this.onPause());
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ class MediaVideo extends React.Component<Props> {
|
|||
const node = $(this.node);
|
||||
const video = node.find('video');
|
||||
|
||||
video.on('play', () => this.onPlay());
|
||||
video.on('pause', () => this.onPause());
|
||||
video.on('ended', () => this.onEnded());
|
||||
video.on('play', () => this.onPlay());
|
||||
video.on('pause', () => this.onPause());
|
||||
video.on('ended', () => this.onEnded());
|
||||
};
|
||||
|
||||
unbind () {
|
||||
|
|
|
@ -37,7 +37,7 @@ class Pager extends React.Component<Props> {
|
|||
};
|
||||
|
||||
const Item = (item) => (
|
||||
<div className={'pageItem ' + (item.id == page ? 'active' : '')} onClick={() => this.onChange(item.id)}>
|
||||
<div className={'pageItem ' + (item.id == page ? 'active' : '')} onClick={() => this.onChange(item.id)}>
|
||||
{item.id}
|
||||
</div>
|
||||
);
|
||||
|
@ -79,15 +79,15 @@ class Pager extends React.Component<Props> {
|
|||
if (items.length > 1) {
|
||||
return (
|
||||
<div className={[ 'pager', (isShort ? 'isShort' : '') ].join(' ')}>
|
||||
{isShort ? <Icon className={[ 'arrow', 'end', 'left', (page == 1 ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(1)} /> : ''}
|
||||
<Icon className={[ 'arrow', 'left', (page == 1 ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(page - 1)} />
|
||||
{isShort ? <Icon className={[ 'arrow', 'end', 'left', (page == 1 ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(1)} /> : ''}
|
||||
<Icon className={[ 'arrow', 'left', (page == 1 ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(page - 1)} />
|
||||
|
||||
{startPage}
|
||||
{list}
|
||||
{endPage}
|
||||
|
||||
<Icon className={[ 'arrow', 'right', (page == pages ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(page + 1)} />
|
||||
{isShort ? <Icon className={[ 'arrow', 'end', 'right', (page == pages ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(pages)} /> : ''}
|
||||
<Icon className={[ 'arrow', 'right', (page == pages ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(page + 1)} />
|
||||
{isShort ? <Icon className={[ 'arrow', 'end', 'right', (page == pages ? 'disabled' : '') ].join(' ')} onClick={() => this.onChange(pages)} /> : ''}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -422,8 +422,8 @@ const WidgetIndex = observer(class WidgetIndex extends React.Component<Props> {
|
|||
subIds: Constant.menuIds.widget,
|
||||
vertical: I.MenuDirection.Center,
|
||||
horizontal: I.MenuDirection.Right,
|
||||
onOpen: () => node.addClass('active'),
|
||||
onClose: () => node.removeClass('active'),
|
||||
onOpen: () => node.addClass('active'),
|
||||
onClose: () => node.removeClass('active'),
|
||||
data: {
|
||||
...block.content,
|
||||
target: object,
|
||||
|
|
|
@ -178,8 +178,8 @@ const WidgetListItem = observer(class WidgetListItem extends React.Component<Pro
|
|||
const menuParam: any = {
|
||||
className: 'fixed',
|
||||
classNameWrap: 'fromSidebar',
|
||||
onOpen: () => node.addClass('active'),
|
||||
onClose: () => node.removeClass('active'),
|
||||
onOpen: () => node.addClass('active'),
|
||||
onClose: () => node.removeClass('active'),
|
||||
data: {
|
||||
route: 'Widget',
|
||||
objectIds: [ id ],
|
||||
|
|
|
@ -153,8 +153,8 @@ const TreeItem = observer(class Node extends React.Component<Props> {
|
|||
const menuParam: any = {
|
||||
className: 'fixed',
|
||||
classNameWrap: 'fromSidebar',
|
||||
onOpen: () => node.addClass('active'),
|
||||
onClose: () => node.removeClass('active'),
|
||||
onOpen: () => node.addClass('active'),
|
||||
onClose: () => node.removeClass('active'),
|
||||
data: {
|
||||
route: 'Widget',
|
||||
objectIds: [ id ],
|
||||
|
|
|
@ -82,7 +82,7 @@ class Focus {
|
|||
el.focus({ preventScroll: true });
|
||||
|
||||
if (node.hasClass('input')) {
|
||||
window.setTimeout(() => (el as HTMLInputElement).setSelectionRange(range.from, range.to));
|
||||
window.setTimeout(() => (el as HTMLInputElement).setSelectionRange(range.from, range.to));
|
||||
} else
|
||||
if (node.hasClass('editable')) {
|
||||
keyboard.setFocus(true);
|
||||
|
|
|
@ -120,7 +120,7 @@ class Preview {
|
|||
node.css({ left: x, top: y }).addClass('show');
|
||||
|
||||
window.clearTimeout(this.timeout.delay);
|
||||
this.timeout.delay = window.setTimeout(() => this.delayTooltip = delay, 500);
|
||||
this.timeout.delay = window.setTimeout(() => this.delayTooltip = delay, 500);
|
||||
this.delayTooltip = 100;
|
||||
}, this.delayTooltip);
|
||||
};
|
||||
|
@ -232,7 +232,7 @@ class Preview {
|
|||
toastShow (param: I.Toast) {
|
||||
const setTimeout = () => {
|
||||
window.clearTimeout(this.timeout.toast);
|
||||
this.timeout.toast = window.setTimeout(() => this.toastHide(false), Constant.delay.toast);
|
||||
this.timeout.toast = window.setTimeout(() => this.toastHide(false), Constant.delay.toast);
|
||||
};
|
||||
|
||||
commonStore.toastSet(param);
|
||||
|
@ -241,8 +241,8 @@ class Preview {
|
|||
|
||||
setTimeout();
|
||||
obj.off('mouseenter.toast mouseleave.toast');
|
||||
obj.on('mouseenter.toast', () => window.clearTimeout(this.timeout.toast));
|
||||
obj.on('mouseleave.toast', () => setTimeout());
|
||||
obj.on('mouseenter.toast', () => window.clearTimeout(this.timeout.toast));
|
||||
obj.on('mouseleave.toast', () => setTimeout());
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -208,7 +208,7 @@ class UtilObject {
|
|||
|
||||
keyboard.setSource(null);
|
||||
historyPopup.pushMatch(param.data.matchPopup);
|
||||
window.setTimeout(() => popupStore.open('page', param), Constant.delay.popup);
|
||||
window.setTimeout(() => popupStore.open('page', param), Constant.delay.popup);
|
||||
};
|
||||
|
||||
create (rootId: string, targetId: string, details: any, position: I.BlockPosition, templateId: string, fields: any, flags: I.ObjectFlag[], callBack?: (message: any) => void) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue