Skip to content

Commit

Permalink
Refactor url modal creation
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Aug 15, 2024
1 parent 3e8a32e commit 3e363ac
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions js/widgets/loadWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,11 @@ import FileLoadManager from "./fileLoadManager.js"
import FileLoadWidget from "./fileLoadWidget.js"
import * as Utils from "./utils.js"
import AlertSingleton from "./alertSingleton.js"
import {createURLModalElement} from "./urlModal.js"

function createURLWidget(igvMain, urlModalId, urlModalTitle, loadHandler) {

const html =
`<div id="${ urlModalId }" class="modal fade" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">${ urlModalTitle }</div>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>`

const fragment = document.createRange().createContextualFragment(html)
const urlModalElement = fragment.firstChild
const urlModalElement = createURLModalElement(urlModalId, urlModalTitle)

igvMain.appendChild(urlModalElement)

Expand Down

0 comments on commit 3e363ac

Please sign in to comment.