Skip to content
Permalink
Browse files

add styles and js to posts

  • Loading branch information...
3v0k4 committed Jul 15, 2019
1 parent 77567ed commit 5fb4b964e0890a042b868738d32a99680c06836e
Showing with 15 additions and 0 deletions.
  1. +2 −0 templates/posts.cassius
  2. +3 −0 templates/posts.hamlet
  3. +10 −0 templates/posts.julius
@@ -0,0 +1,2 @@
#new-post
display: none
@@ -1,5 +1,8 @@
<h1>Posts

<button id="toggle-new-post">
Toggle Form

<div id="new-post">
<form method=post action=@{PostsR} enctype=#{enctype}>
^{widget}
@@ -0,0 +1,10 @@
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("toggle-new-post").addEventListener("click", function() {
var value =
document.getElementById("new-post").style.display === "block"
? "none"
: "block";

document.getElementById("new-post").style.display = value;
});
});

0 comments on commit 5fb4b96

Please sign in to comment.
You can’t perform that action at this time.