Skip to content

Commit 030be16

Browse files
committed
Updated mount point for modal
1 parent 69fe411 commit 030be16

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
</head>
1010
<body>
1111
<button onclick="openFileManager(callback)">Open File Manager</button>
12-
<div class="app"></div>
12+
<div class="app">
13+
<p>Hello</p>
14+
</div>
15+
<p>Hello</p>
1316
<script src="dist/build.js"></script>
1417
<script>
1518
function callback(list) {

src/core/file-manager.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ const FileManager = class FileManager extends Component {
2626
this.store.server = props.server;
2727
}
2828

29+
setMountPoint = dom_el => {
30+
this.store.mount_point = dom_el;
31+
};
32+
2933
openFileManager = (cb, config) => {
3034
this.store.openFileManager(cb, config);
3135
};
@@ -51,6 +55,7 @@ const FileManager = class FileManager extends Component {
5155
footer={null}
5256
onCancel={this.handleCancel}
5357
width={window.innerWidth/1.5}
58+
getContainer={this.store.mount_point}
5459
>
5560
{this.store.tabs.length ? <Tabs defaultActiveKey={this.store.tabs[0].hook} prefixCls="qxui-tabs">
5661
{this.store.tabs

src/core/store.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const FILTERS = ["image", "video", "dir", "icon"];
2424

2525
export default class FMStore {
2626
config = observable({
27+
mount_point: null,
2728
//components and hard coded core data
2829
plugins: {
2930
new_dir: {
@@ -206,6 +207,10 @@ export default class FMStore {
206207
this.config.data.server = server;
207208
};
208209

210+
set mount_point(dom_el) {
211+
this.config.mount_point = dom_el;
212+
};
213+
209214
setCallback = callback => {
210215
this.config.data.callback = callback;
211216
};
@@ -256,6 +261,10 @@ export default class FMStore {
256261
return this.config.data.callback;
257262
}
258263

264+
get mount_point() {
265+
return () => this.config.mount_point;
266+
}
267+
259268
//all core information
260269
get data() {
261270
return this.config.data;

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export default function (server, dom) {
1818

1919
const file_manager = render(FMElement, fm_div);
2020

21+
file_manager.setMountPoint(fm_div);
22+
2123
window.ReactFileManager.registerPlugin = file_manager.registerPlugin;
2224
window.ReactFileManager.openFileManager = file_manager.openFileManager;
2325

0 commit comments

Comments
 (0)