@@ -151,8 +151,9 @@ export class GmailElementReplacer extends WebmailElementReplacer {
151151 $ ( document ) . on ( 'click' , 'div.aHU.hx' , event => {
152152 const $actionsBtn = $ ( event . currentTarget ) . find ( this . sel . msgActionsBtn ) ;
153153 if ( $actionsBtn . length && ! $ ( '.action_menu_message_button' ) . length ) {
154- this . addMenuButton ( 'reply' , '#r' ) ;
155- this . addMenuButton ( 'forward' , '#r3' ) ;
154+ this . addMenuButton ( 'a_reply' , '#r' ) ;
155+ this . addMenuButton ( 'a_reply_all' , '#r2' ) ;
156+ this . addMenuButton ( 'a_forward' , '#r3' ) ;
156157 }
157158 } ) ;
158159 } ;
@@ -292,19 +293,12 @@ export class GmailElementReplacer extends WebmailElementReplacer {
292293
293294 private addMenuButton = ( replyOption : ReplyOption , selector : string ) => {
294295 const gmailActionsMenuContainer = $ ( this . sel . msgActionsMenu ) . find ( selector ) ;
295- const button = $ ( this . factory . actionsMenuBtn ( replyOption ) ) . insertAfter ( gmailActionsMenuContainer ) ; // xss-safe-factory
296- button . on (
297- 'click' ,
298- Ui . event . handle ( ( el , ev : JQuery . Event ) => this . actionActivateSecureReplyHandler ( el , ev ) )
299- ) ;
300- } ;
301-
302- private replaceActionsMenu = ( ) => {
303- if ( $ ( '.action_menu_message_button' ) . length <= 0 ) {
304- this . addMenuButton ( 'a_reply' , '#r' ) ;
305- // * when adding the reply_all button, check if #r2, the placeholder for reply_all, is visible
306- // * otherwise, it's not wise adding reply_all for single recipient emails
307- this . addMenuButton ( 'a_forward' , '#r3' ) ;
296+ if ( $ ( selector ) . css ( 'display' ) === 'block' ) {
297+ const button = $ ( this . factory . actionsMenuBtn ( replyOption ) ) . insertAfter ( gmailActionsMenuContainer ) ; // xss-safe-factory
298+ button . on (
299+ 'click' ,
300+ Ui . event . handle ( ( el , ev : JQuery . Event ) => this . actionActivateSecureReplyHandler ( el , ev ) )
301+ ) ;
308302 }
309303 } ;
310304
0 commit comments