Solved bug with metrics in createExperiment
<script>
function destroy() {
li = this.parentElement
+ if (li.parentElement.id == "metricsList") document.getElementById("addedMetric").checked = false
li.parentElement.removeChild(li);
}
function newListElement(listToUpdate, identifier, content) {
- if (listToUpdate == "optimizeMetrics") {
+ if (listToUpdate == "metricsList") {
content.type = "optimize";
lastChild = document.getElementById(listToUpdate).lastChild;
if (lastChild.tagName == "LI" || lastChild.tagName == "li") lastChild.remove()
+ document.getElementById("addedMetric").checked = true
} else {
content.type = "track";
}
</div>
</div>
</div>
+
+ <div class="separator">
+ <ul>
+ </ul>
+ </div>
+
<div id="services" class="metricBlock">
<div class="container">
<div class="row">
</div>
</div>
<div class="row">
+ <input class="invisibleRadioBtn" type="checkbox" id="addedMetric"
+ name="test" required>
<div class="col-lg-12" id="optimizeMetrics">
</div>
</div>
+ <div class="row">
+ <div id="Metrics">
+ <ul id="metricsList">
+ </ul>
+ </div>
</div>
</div>
- <div id="Metrics">
- <ul class="list-unstyled li-space-lg" id="metricsList">
+ </div>
+
+ <div class="separator">
+ <ul>
</ul>
</div>
+
<div id="services-2" class="metricBlock">
<div class="container">
<div class="row">
<div class="col-lg-12" id="trackMetrics">
</div>
</div>
+ <div class="row">
+ <div id="trackedMetrics">
+ <ul id="trackmetricsList">
+ </ul>
</div>
</div>
- <div id="trackedMetrics">
- <ul class="list-unstyled li-space-lg" id="trackmetricsList">
+ </div>
+ </div>
+
+ <div class="separator">
+ <ul>
</ul>
</div>
+
<div class="customContainer">
<div class="container">
<div class="row">
}
//newListElement(where, name, JSON.stringify(content))
- newListElement(where, name, content)
+ where2 = where;
+ if (where == "optimizeMetrics") where2 = "metricsList"
+ if (where == "trackMetrics") where2 = "trackmetricsList"
+
+ newListElement(where2, name, content)
})
