aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/WebBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-03-10 09:50:46 -0400
committerbobzel <zzzman@gmail.com>2024-03-10 09:50:46 -0400
commit4caca5b32f74beed00bfbdaa181cb69fc001b7ca (patch)
tree5601b1bdaa8499af44d2ca50dd845ea0a65128b4 /src/client/views/nodes/WebBox.tsx
parent3735fd5e8c0f5315d73a28ef59dcff4bc6158c88 (diff)
parenta9eb266296d1b71f1016c867f39e20299c011eea (diff)
Merge branch 'master' into zach-starter
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r--src/client/views/nodes/WebBox.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index 2c5398e40..c9340edc0 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -14,7 +14,7 @@ import { listSpec } from '../../../fields/Schema';
import { Cast, NumCast, StrCast, WebCast } from '../../../fields/Types';
import { ImageField, WebField } from '../../../fields/URLField';
import { TraceMobx } from '../../../fields/util';
-import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, emptyFunction, getWordAtPoint, lightOrDark, returnFalse, returnOne, returnZero, setupMoveUpEvents, smoothScroll, stringHash, Utils } from '../../../Utils';
+import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, DivHeight, emptyFunction, getWordAtPoint, lightOrDark, returnFalse, returnOne, returnZero, setupMoveUpEvents, smoothScroll, stringHash, Utils } from '../../../Utils';
import { Docs, DocUtils } from '../../documents/Documents';
import { DocumentManager } from '../../util/DocumentManager';
import { ScriptingGlobals } from '../../util/ScriptingGlobals';
@@ -83,7 +83,7 @@ export class WebBox extends ViewBoxAnnotatableComponent<FieldViewProps>() implem
return this.webField?.toString() || '';
}
@computed get _urlHash() {
- return ""+ (stringHash(this._url)??'');
+ return '' + (stringHash(this._url) ?? '');
}
@computed get scrollHeight() {
return Math.max(NumCast(this.layoutDoc._height), this._scrollHeight);
@@ -782,7 +782,7 @@ export class WebBox extends ViewBoxAnnotatableComponent<FieldViewProps>() implem
className="webBox-htmlSpan"
ref={action((r: any) => {
if (r) {
- this._scrollHeight = Number(getComputedStyle(r).height.replace('px', ''));
+ this._scrollHeight = DivHeight(r);
this.lighttext = Array.from(r.children).some((c: any) => c instanceof HTMLElement && lightOrDark(getComputedStyle(c).color) !== Colors.WHITE);
}
})}