mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-07-14 04:34:04 +00:00
Implement OOP hosttree (#32)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
20
frontend/src/lib/dialogs.js
Normal file
20
frontend/src/lib/dialogs.js
Normal file
@ -0,0 +1,20 @@
|
||||
function newDialog(dialogComponent, data = {}) {
|
||||
const outlet = document.createElement('div');
|
||||
outlet.className = 'dialogoutlet';
|
||||
document.getElementById('dialogoutlets').appendChild(outlet);
|
||||
|
||||
const instance = new dialogComponent({ target: outlet, props: data });
|
||||
|
||||
instance.$close = function() {
|
||||
instance.$destroy();
|
||||
outlet.remove();
|
||||
};
|
||||
|
||||
instance.$on('close', instance.$close);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
const dialogs = { new: newDialog };
|
||||
|
||||
export default dialogs;
|
Reference in New Issue
Block a user