File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -76,21 +76,21 @@ - (NSArray *) webView:(WebView *)sender
76
76
{
77
77
DOMNode *node = [element valueForKey: @" WebElementDOMNode" ];
78
78
79
- // If clicked on the text, select the containing div
80
- if ([[node className ] isEqualToString: @" DOMText" ])
81
- node = [node parentNode ];
82
-
83
- // Every ref has a class name of 'refs' and some other class. We check on that to see if we pressed on a ref.
84
- if (![[node className ] hasPrefix: @" refs " ])
85
- return defaultMenuItems;
79
+ while (node) {
80
+ // Every ref has a class name of 'refs' and some other class. We check on that to see if we pressed on a ref.
81
+ if ([[node className ] hasPrefix: @" refs " ]) {
82
+ NSString *selectedRefString = [[[node childNodes ] item: 0 ] textContent ];
83
+ for (PBGitRef *ref in historyController.webCommit .refs )
84
+ {
85
+ if ([[ref shortName ] isEqualToString: selectedRefString])
86
+ return [contextMenuDelegate menuItemsForRef: ref commit: historyController.webCommit];
87
+ }
88
+ NSLog (@" Could not find selected ref!" );
89
+ return defaultMenuItems;
90
+ }
86
91
87
- NSString *selectedRefString = [[[node childNodes ] item: 0 ] textContent ];
88
- for (PBGitRef *ref in historyController.webCommit .refs )
89
- {
90
- if ([[ref shortName ] isEqualToString: selectedRefString])
91
- return [contextMenuDelegate menuItemsForRef: ref commit: historyController.webCommit];
92
+ node = [node parentNode ];
92
93
}
93
- NSLog (@" Could not find selected ref!" );
94
94
95
95
return defaultMenuItems;
96
96
}
You can’t perform that action at this time.
0 commit comments