aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/WebBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-13 21:17:50 -0500
committerbobzel <zzzman@gmail.com>2023-12-13 21:17:50 -0500
commit1cf241544f8063e3d71406238a584299b6ced794 (patch)
treecb2bf6a71abbe76e8e3ab8d6283c0daab850e0a4 /src/client/views/nodes/WebBox.tsx
parent35f4d108643d310e4e9da107a5839bb74cc6706f (diff)
cleaned up props/_props handling by inherting from ObservableReactComponent
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r--src/client/views/nodes/WebBox.tsx11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index 995f9f6e0..2f92f1edb 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -1,5 +1,5 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { action, computed, IReactionDisposer, makeObservable, observable, ObservableMap, override, reaction, runInAction } from 'mobx';
+import { action, computed, IReactionDisposer, makeObservable, observable, ObservableMap, reaction, runInAction } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import * as WebRequest from 'web-request';
@@ -13,7 +13,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, copyProps, emptyFunction, getWordAtPoint, lightOrDark, returnFalse, returnOne, returnZero, setupMoveUpEvents, smoothScroll, Utils } from '../../../Utils';
+import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, emptyFunction, getWordAtPoint, lightOrDark, returnFalse, returnOne, returnZero, setupMoveUpEvents, smoothScroll, Utils } from '../../../Utils';
import { Docs, DocUtils } from '../../documents/Documents';
import { DocumentManager } from '../../util/DocumentManager';
import { ScriptingGlobals } from '../../util/ScriptingGlobals';
@@ -98,19 +98,12 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
return Cast(this.Document[this._props.fieldKey], WebField)?.url;
}
- _prevProps: ViewBoxAnnotatableProps & FieldViewProps;
- @override _props: ViewBoxAnnotatableProps & FieldViewProps;
constructor(props: ViewBoxAnnotatableProps & FieldViewProps) {
super(props);
- this._props = this._prevProps = props;
makeObservable(this);
this._webUrl = this._url; // setting the weburl will change the src parameter of the embedded iframe and force a navigation to it.
}
- componentDidUpdate() {
- copyProps(this);
- }
-
@action
search = (searchString: string, bwd?: boolean, clear: boolean = false) => {
if (!this._searching && !clear) {