Browse Source

Fixed error where hidden section headers weren't reappearing in editMode

Nathan Schneider 4 years ago
parent
commit
7225feb33a
1 changed files with 7 additions and 10 deletions
  1. 7 10
      _layouts/rule.html

+ 7 - 10
_layouts/rule.html

@@ -150,17 +150,13 @@ These are the major functional buttons*/
           // Inefficient! Might be merged with the above iteration
           var sections = document.getElementsByClassName("section");
           for (var i = 0; i < sections.length; i++) {
-              console.log(sections[i]);
               var sectionQuestions = sections[i].getElementsByClassName("editable");
               var blanks = 0;
               for (var x = 0; x < sectionQuestions.length; x++) {
                   console.log(sectionQuestions[x].innerHTML);
                   if (sectionQuestions[x].innerHTML == "") { blanks++; }
                   if (blanks == sectionQuestions.length) {
-                      console.log(sections[i].style.display)
-                      console.log("triggered!");
                       var headerID = "header-s" + (i + 1);
-                      console.log("removing: " + headerID);
                       document.getElementById(headerID).style.display = "none";
                   }
               }
@@ -171,7 +167,8 @@ These are the major functional buttons*/
           editMode = true;
           classDisplayAll("button","block");
           classDisplayAll("question","block");
-          classDisplayAll("editable","block");          
+          classDisplayAll("editable","block");
+          classDisplayAll("header","block");
           classDisplayAll("section","none");
           var editableFields = document.getElementsByClassName("editable");
           for (var i = 0; i < editableFields.length; i++) {
@@ -350,7 +347,7 @@ These are the major functional buttons*/
     <h1 contenteditable="true" class="editable output" id="communityname">{{ page.community-name }}</h1>
 
     <!-- SECTION S1: BASICS -->
-    <h2 id="header-s1">
+    <h2 id="header-s1" class="header">
       <img src="{% link assets/tabler_icons/info-circle.svg %}"
            class="icons" />
       <span class="subhead output">Basics</span>
@@ -382,7 +379,7 @@ These are the major functional buttons*/
     </div><!--hiding section s1-->
 
     <!-- SECTION s2: PARTICIPANTS -->
-    <h2 id="header-s2">
+    <h2 id="header-s2" class="header">
       <img src="{% link assets/tabler_icons/user.svg %}"
            class="icons" />
       <span class="subhead output">Participants</span>
@@ -419,7 +416,7 @@ These are the major functional buttons*/
   </div><!--hiding section s2-->
 
   <!--SECTION s3: POLICY-->
-  <h2 id="header-s3">
+  <h2 id="header-s3" class="header">
     <img src="{% link assets/tabler_icons/news.svg %}"
          class="icons" />
     <span class="subhead output">Policy</span>
@@ -451,7 +448,7 @@ These are the major functional buttons*/
   </div><!--hiding section s3-->
 
   <!-- SECTION s4: PROCESS -->
-  <h2 id="header-s4">
+  <h2 id="header-s4" class="header">
     <img src="{% link assets/tabler_icons/refresh.svg %}"
          class="icons" />
     <span class="subhead output">Process</span>
@@ -480,7 +477,7 @@ These are the major functional buttons*/
   </div><!--hiding section s4-->
 
   <!-- SECTION s5: EVOLUTION -->
-  <h2 id="header-s5">
+  <h2 id="header-s5" class="header">
     <img src="{% link assets/tabler_icons/adjustments.svg %}"
          class="icons" />
     <span class="subhead output">Evolution</span>