Skip to content

Commit 8d0b983

Browse files
committed
gmail.dom.email_contents() now filters valid divs
Instead of just returning all divs, the function now further verifies the box having email content and removes the other DOM elements
1 parent f282b6c commit 8d0b983

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/gmail.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,15 @@ var Gmail = function() {
132132

133133

134134
api.dom.email_contents = function() {
135-
return $('.ii.gt');
136-
}
137-
138-
139-
// TODO: Check if this is still useful
140-
api.get.email_ids = function () {
141-
var items = api.dom.email_contents();
135+
var items = $('.ii.gt');
142136
var ids = [];
143137

144138
for(var i=0; i<items.length; i++) {
145139
var mail_id = items[i].getAttribute('class').split(' ')[2];
146140
var is_editable = items[i].getAttribute('contenteditable');
147141
if(mail_id != 'undefined' && mail_id != undefined) {
148142
if(is_editable != 'true') {
149-
ids.push(mail_id);
143+
ids.push(items[i]);
150144
}
151145
}
152146
}
@@ -835,4 +829,4 @@ var Gmail = function() {
835829

836830

837831
return api;
838-
}
832+
}

0 commit comments

Comments
 (0)