@@ -69,8 +69,6 @@ class EditorToolbar {
6969 } % + var(--editor-toolbar-vert-offset))`;
7070 }
7171
72- this . #addDeleteButton( ) ;
73-
7472 return editToolbar ;
7573 }
7674
@@ -118,7 +116,7 @@ class EditorToolbar {
118116 this . #altText?. shown ( ) ;
119117 }
120118
121- # addDeleteButton( ) {
119+ addDeleteButton ( ) {
122120 const { editorType, _uiManager } = this . #editor;
123121
124122 const button = document . createElement ( "button" ) ;
@@ -145,22 +143,39 @@ class EditorToolbar {
145143 async addAltText ( altText ) {
146144 const button = await altText . render ( ) ;
147145 this . #addListenersToElement( button ) ;
148- this . #buttons. prepend ( button , this . #divider) ;
146+ this . #buttons. append ( button , this . #divider) ;
149147 this . #altText = altText ;
150148 }
151149
152150 addColorPicker ( colorPicker ) {
153151 this . #colorPicker = colorPicker ;
154152 const button = colorPicker . renderButton ( ) ;
155153 this . #addListenersToElement( button ) ;
156- this . #buttons. prepend ( button , this . #divider) ;
154+ this . #buttons. append ( button , this . #divider) ;
157155 }
158156
159157 async addEditSignatureButton ( signatureManager ) {
160158 const button = ( this . #signatureDescriptionButton =
161159 await signatureManager . renderEditButton ( this . #editor) ) ;
162160 this . #addListenersToElement( button ) ;
163- this . #buttons. prepend ( button , this . #divider) ;
161+ this . #buttons. append ( button , this . #divider) ;
162+ }
163+
164+ async addButton ( name , tool ) {
165+ switch ( name ) {
166+ case "colorPicker" :
167+ this . addColorPicker ( tool ) ;
168+ break ;
169+ case "altText" :
170+ await this . addAltText ( tool ) ;
171+ break ;
172+ case "editSignature" :
173+ await this . addEditSignatureButton ( tool ) ;
174+ break ;
175+ case "delete" :
176+ this . addDeleteButton ( ) ;
177+ break ;
178+ }
164179 }
165180
166181 updateEditSignatureButton ( description ) {
0 commit comments