diff options
| -rw-r--r-- | t_idea/edit.html | 2 | ||||
| -rw-r--r-- | t_idea/index.html | 19 | 
2 files changed, 10 insertions, 11 deletions
| diff --git a/t_idea/edit.html b/t_idea/edit.html index 8a7885c..725a111 100644 --- a/t_idea/edit.html +++ b/t_idea/edit.html @@ -33,7 +33,7 @@ input[name="title"] {          <div class="idea">              <form action="/idea/edit/" method="post">              <input name="title" type="text" value="{{.Title}}"><br> -            <textarea name="text" rows=4 required>{{.Text}}</textarea> +            <textarea name="text" rows=6 required>{{.Text}}</textarea>              <p class="creation">by <span class="author">{{.Author}}</span> on <span class="date">{{.CreatedAt}}</span></p>                  <input type="submit" value="confirm">              </form> diff --git a/t_idea/index.html b/t_idea/index.html index f845628..97b68dd 100644 --- a/t_idea/index.html +++ b/t_idea/index.html @@ -40,24 +40,23 @@          <p><i>No ideas here... Be the first one to think!</i></p>          {{ end }}          </ul> -        <!--template-->      </body>      <script> -        let dels = document.querySelectorAll("form[action=\"/idea/delete/\"]") -        for (el of dels) { +        let dels = document.querySelectorAll("form[action=\"/idea/delete/\"]"); +        for (let el of dels) {              el.addEventListener("submit", function(e) { -                e.preventDefault() +                e.preventDefault();                  if (confirm("are you sure?") === true) { -                    this.submit() +                    this.submit();                  }              })          } -        let eels = document.querySelectorAll("button.edit") -        for (el of eels) { -            el.onclick = function(e) { -                location.href = "/idea/edit?t=" + el.getAttribute("data-title") +        let eels = document.querySelectorAll("button.edit"); +        for (let el of eels) { +            el.onclick = function() { +                let title = el.getAttribute("data-title"); +                location.href = "/idea/edit?t=" + title;              }          } -              </script>  </html> | 
