Skip to content
Snippets Groups Projects
Commit 926b8fc5 authored by Eugen Ciur's avatar Eugen Ciur
Browse files

add basic modal for creating new folder

parent 0d148a6c
No related branches found
No related tags found
No related merge requests found
<div class="modal" tabindex="-1" ...attributes>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{@title}}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{yield}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary">{{@actionTitle}}</button>
</div>
</div>
</div>
</div>
<Modal::Base
@title="Create Folder"
@actionTitle="Create"
...attributes
>
<label for="folder-title" class="form-label">Folder title:</label>
<Input
id="folder-title"
class="form-control"
@type="text"
@value="{{this.title}}"
/>
</Modal::Base>
\ No newline at end of file
import { Modal } from 'bootstrap';
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class IndexController extends Controller {
@action
newFolder(modal_elem_id) {
let modal, dom_elem;
dom_elem = document.getElementById(modal_elem_id);
modal = new Modal(dom_elem, {});
modal.show();
}
}
\ No newline at end of file
<div>
<button class="btn btn-bordered btn-light btn-flat"
type="button">
<i class="fa fa-upload mr-1 text-success"></i>
Upload
</button>
Documents and Folders will be displayed here!
\ No newline at end of file
<button class="btn btn-bordered btn-light btn-flat"
type="button" {{on "click" (fn this.newFolder 'new-folder') }}>
<i class="fa fa-plus mr-1 text-success"></i>
New Folder
</button>
</div>
Documents and Folders will be displayed here!
<Modal::NewFolder id="new-folder"/>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment