Skip to content

Commit

Permalink
Merge pull request #20 from vemonet/group-yasgui-divs-for-customization
Browse files Browse the repository at this point in the history
Improve `div` groupment in Yasgui to enable better customization of the editor interface
  • Loading branch information
ludovicm67 authored Oct 29, 2024
2 parents fff5f0d + f52e9ab commit cfec5d9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/yasgui/src/Tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,28 @@ export class Tab extends EventEmitter {
this.rootEl.setAttribute("role", "tabpanel");
this.rootEl.setAttribute("aria-labelledby", "tab-" + this.persistentJson.id);

const wrapper = document.createElement("div");
// We group controlbar and Yasqe, so that users can easily .appendChild() to the .editorwrapper div
// to add a div that goes alongside the controlbar and editor, while YASR still goes full width
// Useful for adding an infos div that goes alongside the editor without needing to rebuild the whole Yasgui class
const editorWrapper = document.createElement("div");
editorWrapper.className = "editorwrapper";
const controlbarAndYasqeDiv = document.createElement("div");
//controlbar
this.controlBarEl = document.createElement("div");
this.controlBarEl.className = "controlbar";
wrapper.appendChild(this.controlBarEl);
controlbarAndYasqeDiv.appendChild(this.controlBarEl);

//yasqe
this.yasqeWrapperEl = document.createElement("div");
wrapper.appendChild(this.yasqeWrapperEl);
controlbarAndYasqeDiv.appendChild(this.yasqeWrapperEl);
editorWrapper.appendChild(controlbarAndYasqeDiv);

//yasr
this.yasrWrapperEl = document.createElement("div");
wrapper.appendChild(this.yasrWrapperEl);

this.initTabSettingsMenu();
this.rootEl.appendChild(wrapper);
this.rootEl.appendChild(editorWrapper);
this.rootEl.appendChild(this.yasrWrapperEl);
this.initControlbar();
this.initYasqe();
this.initYasr();
Expand Down

0 comments on commit cfec5d9

Please sign in to comment.