@seafile/sdoc-editor 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { DOCUMENT_PLUGIN_EDITOR, WIKI_EDITOR } from '../constants';
1
+ import { WIKI_EDITOR, DOCUMENT_PLUGIN_EDITOR } from '../constants';
2
2
  export const getDomHeight = dom => {
3
3
  const styles = window.getComputedStyle(dom);
4
4
  const rect = dom.getBoundingClientRect();
@@ -58,9 +58,10 @@ export const getHeaderHeight = editor => {
58
58
  } = editor;
59
59
  switch (editorType) {
60
60
  case WIKI_EDITOR:
61
- const headerHeight = document.querySelector('.sdoc-editor-container').offsetTop; // async height in wiki
62
- const headerBarHeight = 44;
63
- return headerHeight + headerBarHeight;
61
+ // Wiki header is async value
62
+ const headerTop = document.querySelector('.wiki-page-header-wrapper').offsetHeight;
63
+ // top nav is 44px
64
+ return headerTop + 44;
64
65
  case DOCUMENT_PLUGIN_EDITOR:
65
66
  return 67 + 48 + 49 + 37;
66
67
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",