Skip to content

Commit 99c6247

Browse files
authored
Fix classes used for detecting threads (#735)
* Fix classes used for detecting threads * fix type issue * simplify
1 parent 6a7a26e commit 99c6247

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/gmail.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,11 @@ var Gmail = function(localJQuery) {
283283
// There are currently two selectors in use for view_thread: Bu and nH,
284284
// Which correspond to two different ways a thread may be viewed by the user.
285285
// There are two different code paths to determine if we are within a thread.
286+
286287
// This is the nH path:
287-
// this should match the sub_selector (nH -> if)
288-
var check_1 = $(".nH .if").children(":eq(1)").children().children(":eq(1)").children();
288+
// this should match the sub_selector (nH -> if/iY):
289+
var check_1 = $(".nH .if,.iY").children(":eq(1)").children().children(":eq(1)").children();
290+
289291
// And this is the Bu path. We don't bother here checking for the sub_selector.
290292
var check_2 = api.get.email_ids();
291293

@@ -2470,7 +2472,7 @@ var Gmail = function(localJQuery) {
24702472
// which is triggered by the XHR request rather than nodes being inserted into the DOM (and thus returns different information)
24712473
"view_thread": {
24722474
class: ["Bu", "nH"], // class depends if is_preview_pane - Bu for preview pane, nH for standard view
2473-
sub_selector: "div.if,div.PeIF1d",
2475+
sub_selector: "div.if,div.iY",
24742476
handler: function(match, callback) {
24752477
match = new api.dom.thread(match);
24762478
callback(match);
@@ -4473,7 +4475,7 @@ var Gmail = function(localJQuery) {
44734475
}
44744476

44754477
// this should match the sub_selector
4476-
if (!element || (!element.hasClass("if") && !element.hasClass("PeIF1d"))) api.tools.error("api.dom.thread called with invalid element/id");
4478+
if (!element || (!element.hasClass("if") && !element.hasClass("iY"))) api.tools.error("api.dom.thread called with invalid element/id");
44774479
this.$el = element;
44784480
return this;
44794481
};

0 commit comments

Comments
 (0)