Skip to content
Snippets Groups Projects
Commit 32580424 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Create verifier button dynamically

parent eede80f1
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
<div class="editor-tabs"></div> <div class="editor-tabs"></div>
</div> </div>
</div> </div>
<button id="button-dmn-verify" onclick="checkVerifications()">Get verifications</button>
<div id="root-dmn-verifier"></div> <div id="root-dmn-verifier"></div>
</div> </div>
......
...@@ -7,12 +7,17 @@ let dmnApi = rootUrl + 'api/dmn/'; ...@@ -7,12 +7,17 @@ let dmnApi = rootUrl + 'api/dmn/';
*/ */
let verifierResults = {}; let verifierResults = {};
function checkVerifications() { function cleanDmnVerifierRoot() {
getVerifications(); let $root = $('#root-dmn-verifier').empty();
$root.append($(`
<button id="button-dmn-verify" onClick="checkVerifications()">
Get verifications</button>
`));
return $root;
} }
function cleanDmnVerifierRoot() { function checkVerifications() {
$('#root-dmn-verifier').empty(); getVerifications();
} }
function getVerifications() { function getVerifications() {
...@@ -60,7 +65,7 @@ function getVerifications() { ...@@ -60,7 +65,7 @@ function getVerifications() {
function renderDmnVerifierOptions() { function renderDmnVerifierOptions() {
// reset div // reset div
let $root = $('#root-dmn-verifier'); let $root = cleanDmnVerifierRoot();
let $select = $(` let $select = $(`
<select name="verifier" id="verifier" onchange="renderVerifierResult(this)"> <select name="verifier" id="verifier" onchange="renderVerifierResult(this)">
`); `);
...@@ -81,7 +86,7 @@ function renderDmnVerifierOptions() { ...@@ -81,7 +86,7 @@ function renderDmnVerifierOptions() {
} }
$curGroup.append(renderSelectEntry(verifierResults.verifier[i])); $curGroup.append(renderSelectEntry(verifierResults.verifier[i]));
} }
$root.html($select); $root.append($select);
$root.append($(`<div id="verifier-entries">`)); $root.append($(`<div id="verifier-entries">`));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment