1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-10 10:00:48 +09:00
This commit is contained in:
Andrew Simachev 2023-11-08 14:38:56 +01:00
parent 2b5650636e
commit dcc3f7c3f8
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
2 changed files with 7 additions and 2 deletions

View file

@ -34,6 +34,10 @@
window.addEventListener('resize', resize);
window.addEventListener('error', e => {
e.preventDefault();
});
function resize (e) {
window.parent.postMessage({ height: document.documentElement.scrollHeight }, '*');
};

View file

@ -1721,6 +1721,7 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
const first = blockStore.getFirstBlock(rootId, 1, (it) => it.isText() && !it.isTextTitle() && !it.isTextDescription());
const object = detailStore.get(rootId, rootId, [ 'internalFlags' ]);
const isEmpty = first && (focused == first.id) && !first.getLength() && (object.internalFlags || []).includes(I.ObjectFlag.DeleteEmpty);
const position = length ? I.BlockPosition.Bottom : I.BlockPosition.Replace;
const options: any[] = [
{ id: 'link', name: translate('editorPagePasteLink') },
@ -1810,7 +1811,7 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
};
case 'block': {
C.BlockBookmarkCreateAndFetch(rootId, focused, length ? I.BlockPosition.Bottom : I.BlockPosition.Replace, url, (message: any) => {
C.BlockBookmarkCreateAndFetch(rootId, focused, position, url, (message: any) => {
if (!message.error.code) {
analytics.event('CreateBlock', { middleTime: message.middleTime, type: I.BlockType.Bookmark });
};
@ -1848,7 +1849,7 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat
};
};
this.blockCreate(block.id, I.BlockPosition.Bottom, {
this.blockCreate(block.id, position, {
type: I.BlockType.Embed,
content: {
processor,