aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/static/moduleeditor.js
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/static/moduleeditor.js')
-rw-r--r--internal/admin/static/moduleeditor.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/admin/static/moduleeditor.js b/internal/admin/static/moduleeditor.js
index f1fb0fd..5bcb7bc 100644
--- a/internal/admin/static/moduleeditor.js
+++ b/internal/admin/static/moduleeditor.js
@@ -67,7 +67,7 @@ function loadModuleEditor(id) {
function loadItem(id) { loadModuleEditor(id); }
function renderModuleEditor(id, data) {
- var html = '<h2>Module: ' + esc(id) + '</h2>';
+ var html = renderRenameableHeader('Module', id);
html += '<div class="tabs"><button class="tab active" onclick="switchTab(event,\'fields\')">Fields</button>';
html += '<button class="tab" onclick="switchTab(event,\'yaml\')">Raw YAML</button></div>';
@@ -187,11 +187,12 @@ function toggleCardWidth(id) {
function removeSection(id) {
var sec = MODULE_SECTIONS.find(function(s) { return s.id === id; });
if (!sec) return;
+ ced_syncDOMToData(moduleData);
if (sec.path) {
delete moduleData[sec.path];
}
delete addedSections[id];
- renderCurrent();
+ renderModuleEditor(moduleID, moduleData);
}
function addSection() {
@@ -227,9 +228,10 @@ function addArrayItem(cardID) {
function removeArrayItem(cardID, idx) {
var sec = MODULE_SECTIONS.find(function(s) { return s.id === cardID; });
if (!sec || !sec.isArray) return;
+ ced_syncDOMToData(moduleData);
var arr = moduleData[sec.path] || [];
arr.splice(idx, 1);
- renderCurrent();
+ renderModuleEditor(moduleID, moduleData);
}
function saveModule() {