Progresses on #76
parent
ef04101eee
commit
a397e89d20
|
@ -4,7 +4,7 @@
|
|||
{{ if or (eq $value.Type "object") (eq $value.Type "array") }}
|
||||
<fieldset id="{{ $value.Name }}" data-type="{{ $value.Type }}">
|
||||
<h3>{{ SplitCapitalize $value.Title }}</h3>
|
||||
<button class="delete">remove</button>
|
||||
<button class="delete" data-delete="{{ $value.Name }}">remove</button>
|
||||
{{ if (eq $value.Type "array") }}<div class="itens">{{ end }}{{ template "frontmatter" $value.Content }}{{ if (eq $value.Type "array") }}<button class="add">+</button></div>{{ end }}
|
||||
</fieldset>
|
||||
{{ else }}
|
||||
|
|
|
@ -254,11 +254,7 @@ $(document).on('page:editor', function() {
|
|||
|
||||
$("#content").on('click', '.delete', function(event) {
|
||||
event.preventDefault();
|
||||
button = $(this);
|
||||
|
||||
name = button.parent().parent().attr("for") || button.parent().parent().attr("id") || button.parent().parent().parent().attr("id");
|
||||
name = name.replace(/\[/, '\\[');
|
||||
name = name.replace(/\]/, '\\]');
|
||||
name = $(this).data("delete");
|
||||
|
||||
$('label[for="' + name + '"]').fadeOut().remove();
|
||||
$('#' + name).fadeOut().remove();
|
||||
|
|
Loading…
Reference in New Issue