dsh-pick 0.2.2 → 0.2.3
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.
- package/package.json +1 -1
- package/plugin/client.js +4 -4
package/package.json
CHANGED
package/plugin/client.js
CHANGED
|
@@ -34,7 +34,7 @@ window.__ModuleLoader__.load({
|
|
|
34
34
|
function PickPanel() {
|
|
35
35
|
const frame = useRef(null)
|
|
36
36
|
const [meta, setMeta] = useState(null)
|
|
37
|
-
const [
|
|
37
|
+
const [frameH, setFrameH] = useState(720)
|
|
38
38
|
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
let alive = true
|
|
@@ -52,12 +52,12 @@ window.__ModuleLoader__.load({
|
|
|
52
52
|
const doc = frame.current && frame.current.contentDocument
|
|
53
53
|
if (doc && doc.body) {
|
|
54
54
|
const need = Math.max(720, doc.body.scrollHeight + 40)
|
|
55
|
-
if (Math.abs(need -
|
|
55
|
+
if (Math.abs(need - frameH) > 40) setFrameH(need)
|
|
56
56
|
}
|
|
57
57
|
} catch { /* 跨域就不管,保持默认高度 */ }
|
|
58
58
|
}, 1500)
|
|
59
59
|
return () => clearInterval(t)
|
|
60
|
-
}, [
|
|
60
|
+
}, [frameH])
|
|
61
61
|
|
|
62
62
|
const tip = !meta
|
|
63
63
|
? L('正在读取目录…', 'Loading catalog…')
|
|
@@ -80,7 +80,7 @@ window.__ModuleLoader__.load({
|
|
|
80
80
|
title: 'dsh-pick',
|
|
81
81
|
style: {
|
|
82
82
|
width: '100%',
|
|
83
|
-
height:
|
|
83
|
+
height: frameH + 'px',
|
|
84
84
|
border: '1px solid ' + C.border,
|
|
85
85
|
borderRadius: '10px',
|
|
86
86
|
background: 'transparent',
|