Преглед изворни кода

BugFix: #create-template-button-link does not become active

Yuki Takei пре 7 година
родитељ
комит
3594805e3a
2 измењених фајлова са 16 додато и 0 уклоњено
  1. 13 0
      lib/views/modal/create_page.html
  2. 3 0
      resource/styles/scss/_create-page.scss

+ 13 - 0
lib/views/modal/create_page.html

@@ -64,6 +64,19 @@
           </fieldset>
         </div>
 
+        <script>
+          $('#template-type').on('change', function() {
+            // enable button
+            $('#link-to-template').removeClass('disabled');
+
+            // modify href
+            const value = $(this).val();
+            const pageName = (value === 'children') ? '_template' : '__template';
+            const link = '{{ page.path || path }}/' + pageName + '#edit-form';
+            $('#link-to-template').attr('href', link);
+          });
+        </script>
+
       </div><!-- /.modal-body -->
 
     </div><!-- /.modal-content -->

+ 3 - 0
resource/styles/scss/_create-page.scss

@@ -20,6 +20,9 @@
         }
         .create-page-button-container {
           margin-left: 15px;
+          .btn {
+            min-width: 105px;
+          }
         }
 
         // change layout by screen size