defined static structure as src/apps/dashboard/static/apps/scripts/dashboard.js for Jasmine testing purposes; efforts to get past textInput=null have thus far been frustrated
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -11,7 +11,7 @@ db.sqlite3
|
||||
db.sqlite3-journal
|
||||
container.db.sqlite3
|
||||
media
|
||||
static
|
||||
src/static
|
||||
|
||||
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
|
||||
# in your Git repository. Update and uncomment the following line accordingly.
|
||||
|
||||
9
src/apps/dashboard/static/apps/scripts/dashboard.js
Normal file
9
src/apps/dashboard/static/apps/scripts/dashboard.js
Normal file
@@ -0,0 +1,9 @@
|
||||
console.log("apps/scripts/dashboard.js loading");
|
||||
const initialize = () => {
|
||||
console.log("initialize called!");
|
||||
const textInput = document.querySelector("id_text");
|
||||
textInput.oninput = () => {
|
||||
const errorMsg = document.querySelector(".invalid-feedback");
|
||||
errorMsg.style.display = "none";
|
||||
};
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title_text %}Start a new to-do list{% endblock title_text %}
|
||||
{% block header_text %}Start a new to-do list{% endblock header_text %}
|
||||
|
||||
{% block form_action %}{% url "new_list" %}{% endblock form_action %}
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title_text %}Your to-do list{% endblock title_text %}
|
||||
{% block header_text %}Your to-do list{% endblock header_text %}
|
||||
|
||||
{% block form_action %}{% url "view_list" list.id %}{% endblock form_action %}
|
||||
|
||||
{% block table %}
|
||||
<table id="id_list_table" class="table">
|
||||
{% for item in list.item_set.all %}
|
||||
<tr><td>{{ forloop.counter }}. {{ item.text }}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock table %}
|
||||
|
||||
@@ -51,4 +51,12 @@
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.8/js/bootstrap.min.js"
|
||||
></script>
|
||||
|
||||
<script>
|
||||
const textInput = document.querySelector('#id_text');
|
||||
textInput.oninput = () => {
|
||||
const errorMsg = document.querySelector(".invalid-feedback");
|
||||
errorMsg.style.display = "none";
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user