1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-10 18:10:54 +09:00

JS-2877: fix

This commit is contained in:
Andrew Simachev 2024-01-02 17:18:45 +01:00
parent 81c2af0cf8
commit 992f0c673b
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
2 changed files with 3 additions and 9 deletions

View file

@ -21,6 +21,7 @@
.twitter-tweet, .instagram-media { margin: 0px !important; display: inline-flex !important; }
.gist-file { margin: 0px !important; }
.cp_embed_iframe { border: 0px !important; }
html.align1 .twitter-tweet, body.align1 .instagram-media { justify-content: center; }
html.align2 .twitter-tweet, body.align2 .instagram-media { justify-content: flex-end; }

View file

@ -10,7 +10,6 @@ const BlockBookmark = observer(class BlockBookmark extends React.Component<I.Blo
_isMounted = false;
node: any = null;
frame = 0;
constructor (props: I.BlockComponent) {
super(props);
@ -262,11 +261,7 @@ const BlockBookmark = observer(class BlockBookmark extends React.Component<I.Blo
};
resize () {
if (this.frame) {
raf.cancel(this.frame);
};
this.frame = raf(() => {
window.setTimeout(() => {
if (!this._isMounted) {
return;
};
@ -274,10 +269,8 @@ const BlockBookmark = observer(class BlockBookmark extends React.Component<I.Blo
const { getWrapperWidth } = this.props;
const node = $(this.node);
const inner = node.find('.inner');
const rect = (node.get(0) as Element).getBoundingClientRect();
const mw = getWrapperWidth();
rect.width <= mw / 2 ? inner.addClass('vertical') : inner.removeClass('vertical');
inner.width() <= getWrapperWidth() / 2 ? inner.addClass('vertical') : inner.removeClass('vertical');
});
};