Skip to content

Commit c632eca

Browse files
committed
Fix cursor for custom compose-buttons.
1 parent 6941042 commit c632eca

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
# Changelog
33

4+
## Version 1.0.11
5+
6+
- Fix cursor when hovering over button created using `gmail.tools.add_compose_button`.
7+
48
## Version 1.0.10
59

610
- Better attempt at fixing incorrect triggering of custom buttons created through GmailJS.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gmail-js",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"description": "JavaScript API for Gmail (useful for chrome extensions)",
55
"main": "src/gmail.js",
66
"types": "src/gmail.d.ts",

src/gmail.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3482,6 +3482,10 @@ var Gmail = function(localJQuery) {
34823482
};
34833483

34843484
api.tools.add_compose_button = function(composeWindow, content_html, onClickFunction, styleClass) {
3485+
var div = $(document.createElement("div"));
3486+
div.attr("class", "gU Up");
3487+
div.attr("style", "cursor: pointer !important; transform: translateY(1px);");
3488+
34853489
var button = $(document.createElement("div"));
34863490
var buttonClasses = "T-I J-J5-Ji aoO T-I-atl L3 gmailjs gmailjscomposebutton ";
34873491
if(styleClass !== undefined){
@@ -3492,7 +3496,10 @@ var Gmail = function(localJQuery) {
34923496
button.html(content_html);
34933497
button.click(onClickFunction);
34943498

3495-
composeWindow.find(".gU.Up > .J-J5-Ji").append(button);
3499+
div.append(button);
3500+
3501+
var sendButton = composeWindow.find(".gU.Up");
3502+
div.insertAfter(sendButton);
34963503

34973504
return button;
34983505
};

0 commit comments

Comments
 (0)