Skip to content

Commit

Permalink
Handle editing the name of the root object variable in SectionsFormMa…
Browse files Browse the repository at this point in the history
…nager
  • Loading branch information
MalekKamel committed Oct 17, 2024
1 parent 68e27a4 commit a01222a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions solara/lib/core/dashboard/brand/SectionsFormManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,20 @@ class SectionItemManager {
const header = document.createElement('div');
header.className = 'card-header';
header.textContent = key === 'root' ? cardTitle : key;
if (key === 'root') {
header.onclick = () => {
this.editJsonSheet.show(
JSON.stringify(this.section.content, null, 2),
cardTitle,
(value) => {
this.section.content = value
this.displayJSONCards()
this.notifyChange()
})
};
}
header.onclick = () => {
if (key !== 'root') {
this.editKey(parent, key)
return
}
this.editJsonSheet.show(
JSON.stringify(this.section.content, null, 2),
cardTitle,
(value) => {
this.section.content = value
this.displayJSONCards()
this.notifyChange()
})
};

const actions = document.createElement('div');
actions.className = 'card-actions';
Expand Down

0 comments on commit a01222a

Please sign in to comment.