Commits

Sam Hart committed 5921788

change flipper

  • Participants
  • Parent commits dfaba20

Comments (0)

Files changed (2)

File main/js/flipper.js

 function unFlip(n) {
   var detail = document.getElementById(n);
+  var flipper_more = document.getElementById("flipper_more_"+n);
+  var flipper_less = document.getElementById("flipper_less_"+n);
 
   if (detail.style.display == "inline") {
       detail.style.display = "none";
+      flipper_less.style.display = "none";
+      flipper_more.style.display = "inline";
   } else {
       detail.style.display = "inline";
+      flipper_more.style.display = "none";
+      flipper_less.style.display = "inline";
   }
 }
 

File main/templates/exp.html

     {% endblock %}
   </p>
   {% if flipper %}
-    <a class="flipper" href="#" onclick="unFlip('{{ flipper_id }}'); return false">More details</a>
+  <a class="flipper" id="flipper_more_{{ flipper_id}}"
+    href="#" onclick="unFlip('{{ flipper_id }}'); return false">More details</a>
+  <a class="flipper" id="flipper_less_{{ flipper_id}}"
+    href="#" onclick="unFlip('{{ flipper_id }}'); return false" style="display: none;">Less details</a>
     <div class="details" id="{{ flipper_id }}">
       {% block flipper_contents %}
       {% endblock %}