remove name print; add js to add item when there's nothing left
parent
a7bffd2e76
commit
2c22f06b03
|
@ -621,7 +621,14 @@ var addFrontMatterItem = function(event) {
|
||||||
document.getElementById(bid).querySelector('.action.add').addEventListener('click', addFrontMatterItem);
|
document.getElementById(bid).querySelector('.action.add').addEventListener('click', addFrontMatterItem);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
block.querySelector('.group').insertAdjacentHTML('beforeend', `<div class="block" id="block-${bid}" data-content="${bid}">
|
let group = block.querySelector('.group');
|
||||||
|
|
||||||
|
if (group == null) {
|
||||||
|
block.insertAdjacentHTML('afterbegin', '<div class="group"></div>');
|
||||||
|
group = block.querySelector('.group');
|
||||||
|
}
|
||||||
|
|
||||||
|
group.insertAdjacentHTML('beforeend', `<div class="block" id="block-${bid}" data-content="${bid}">
|
||||||
<label for="${bid}">${name}</label>
|
<label for="${bid}">${name}</label>
|
||||||
<input name="${bid}" id="${bid}" type="text" data-parent-type="object"></input>
|
<input name="${bid}" id="${bid}" type="text" data-parent-type="object"></input>
|
||||||
<div class="action delete" data-delete="block-${bid}">
|
<div class="action delete" data-delete="block-${bid}">
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -19,9 +18,6 @@ func (i *Info) Update(w http.ResponseWriter, r *http.Request, c *config.Config)
|
||||||
var data map[string]interface{}
|
var data map[string]interface{}
|
||||||
kind := r.Header.Get("kind")
|
kind := r.Header.Get("kind")
|
||||||
|
|
||||||
// TODO: remove
|
|
||||||
fmt.Println(i.Name)
|
|
||||||
|
|
||||||
if kind == "" {
|
if kind == "" {
|
||||||
return http.StatusBadRequest, nil
|
return http.StatusBadRequest, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue