@@ -1234,20 +1234,22 @@ gmail.tools.add_compose_button(compose_ref, 'content_html', function() {
1234
1234
}, ' Custom Style Classes' );
1235
1235
```
1236
1236
1237
- #### gmail.tools.add_attachment_button(attachment_ref, content_html, customCssClass tooltip, onclick_action)
1237
+ #### gmail.tools.add_attachment_button(attachment_ref, content_html, customCssClass, tooltip, onclick_action)
1238
1238
1239
1239
Add a button to an attachment in email-view.
1240
1240
1241
1241
``` js
1242
1242
var emailDom = gmail .dom .email (gmail .get .email_id ());
1243
1243
var attachments = emailDom .attachments ();
1244
- var attachment = attachments[0 ];
1245
1244
1246
1245
var iconUrl = " https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/1024px-Google_%22G%22_Logo.svg.png" ;
1247
1246
var html = ' <img src="' + iconUrl + ' " width="21" height="21" />' ;
1248
- gmail .tools .add_attachment_button (attachment, html, null , " Custom button!" , function () {
1249
- alert (" Attachment " + attachment .name + " clicked!" );
1250
- });
1247
+
1248
+ for (let attachment of attachments) {
1249
+ gmail .tools .add_attachment_button (attachment, html, null , " Custom button!" , function () {
1250
+ alert (" Attachment " + attachment .name + " clicked!" );
1251
+ });
1252
+ }
1251
1253
```
1252
1254
1253
1255
#### gmail.tools.add_modal_window(title, content_html, onClickOk, onClickCancel, onClickClose)
0 commit comments