File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,23 @@ export class DiagramViewer extends HTMLElement {
223223 */
224224 public readonly settings : DiagramSettings = new DiagramSettings ( ) ;
225225
226+ private _toolbarVisible = true ;
227+ /**
228+ * Returns whether toolbar is visible (enabled)
229+ */
230+ public get toolbarVisible ( ) {
231+ return this . _toolbarVisible ;
232+ }
233+ /**
234+ * Sets whether toolbar is visible (enabled)
235+ */
236+ public set toolbarVisible ( value ) {
237+ this . _toolbarVisible = value ;
238+ if ( this . _toolbarContainer !== undefined ) {
239+ this . _toolbarContainer . style . display = value ? '' : 'none' ;
240+ }
241+ }
242+
226243 /**
227244 * Creates a new instance of the Diagram Viewer.
228245 */
@@ -364,7 +381,10 @@ export class DiagramViewer extends HTMLElement {
364381
365382 panel . appendToolbar ( toolbar ) ;
366383
367- this . _toolbarContainer ?. appendChild ( panel ) ;
384+ if ( this . _toolbarContainer !== undefined ) {
385+ this . _toolbarContainer . style . display = this . toolbarVisible ? '' : 'none' ;
386+ this . _toolbarContainer . appendChild ( panel ) ;
387+ }
368388 }
369389
370390 private toolbarButtonClicked ( ev : CustomEvent < ButtonEventData > ) {
Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ export class Experiments {
241241 // this.viewer.stencilSet = networkStencilSet;
242242 // this.viewer.stencilSet = mindMapStencilSet;
243243
244+ this . viewer . toolbarVisible = false ;
245+
244246 const manualState : DiagramState = {
245247 stencils : [
246248 < TextStencilState > {
You can’t perform that action at this time.
0 commit comments