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