Added support for markdown editor within lists (fixes #239)

This commit is contained in:
Djamil Legato
2015-11-24 16:45:20 -08:00
parent 925fe14d7b
commit b7caab8677
5 changed files with 11 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -454,7 +454,7 @@ $(function () {
// make sortable // make sortable
new Sortable(holder[0], { new Sortable(holder[0], {
filter: '.form-input-wrapper', filter: '.form-input-wrapper, .form-markdown-wrapper',
onUpdate: function () { onUpdate: function () {
if (isArray) if (isArray)
reIndex(el); reIndex(el);

View File

@@ -45,6 +45,11 @@
&:first-child a { &:first-child a {
border-top-left-radius: 4px; border-top-left-radius: 4px;
} }
padding: inherit !important;
margin: inherit !important;
border-radius: inherit !important;
border: inherit !important;
} }
.mdeditor-active a { .mdeditor-active a {
background: white; background: white;
@@ -88,6 +93,7 @@
.grav-mdeditor-content { .grav-mdeditor-content {
@include clearfix; @include clearfix;
cursor: text;
border: 1px solid $form-border; border: 1px solid $form-border;
border-top: 0; border-top: 0;
border-bottom-right-radius: $form-border-radius; border-bottom-right-radius: $form-border-radius;

View File

@@ -67,7 +67,7 @@
<button class="button" type="button" data-action="add" data-key-index="{{ lastKey }}"><i class="fa fa-plus"></i> Add item</button> <button class="button" type="button" data-action="add" data-key-index="{{ lastKey }}"><i class="fa fa-plus"></i> Add item</button>
</div> </div>
<script type="text/html" data-collection-template="new"> <ul style="display: none;" data-collection-template="new">
<li data-collection-item="{{ name ~ '.*' }}"> <li data-collection-item="{{ name ~ '.*' }}">
{% if field.fields %} {% if field.fields %}
{% set itemName = name ~ '.*' %} {% set itemName = name ~ '.*' %}
@@ -102,7 +102,7 @@
</div> </div>
{% endif %} {% endif %}
</li> </li>
</script> </ul>
<div style="display: none;" data-collection-config="{{ name }}" data-collection-array="{{ array ? 'true' : 'false' }}"></div> <div style="display: none;" data-collection-config="{{ name }}" data-collection-array="{{ array ? 'true' : 'false' }}"></div>
</div> </div>