Ju99ernaut / grapesjs-component-code-editor

Code editor for grapesjs
MIT License
66 stars 21 forks source link

Sidebar resizing options #8

Closed rvrolijk closed 3 years ago

rvrolijk commented 3 years ago

Awesome plugin and it's exactly what I have been looking for for quite a while. By default, everything works great, however, if the canvas and sidebar have custom and set sizes through css instead of the 85%/15% that's set by default, the plugin will reset to those defaults when resizing the canvas/side bar. For example, if the canvas width is set to calc(100%-250px) and the sidebar width is set to 250px using css, the plugin will reset it both widths to 85% and 15% respectively.

Would there be an option to keep any set widths using css intact?

Ju99ernaut commented 3 years ago

Well the panel sizes are changed through js so it'll always overwrite css, you can modify the options below, particularly the closedState option to match with your css, cv referes to the canvas width and pn is for panel width:

//State when open
openState: {
   cv: '65%',
   pn: '35%'
},
//State when closed
closedState: {
   cv: '85%',
   pn: '15%'
},
Ju99ernaut commented 3 years ago

I'll also work on an option for not over writing css