File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ - (NSArray *) webView:(WebView *)sender
88
88
NSLog (@" Could not find selected ref!" );
89
89
return defaultMenuItems;
90
90
}
91
+ if ([node hasAttributes ] && [[node attributes ] getNamedItem: @" representedFile" ])
92
+ return [historyController menuItemsForPaths: [NSArray arrayWithObject: [[[node attributes ] getNamedItem: @" representedFile" ] value ]]];
91
93
92
94
node = [node parentNode ];
93
95
}
Original file line number Diff line number Diff line change @@ -202,26 +202,32 @@ var showDiff = function() {
202
202
var link = document . createElement ( "a" ) ;
203
203
link . setAttribute ( "href" , "#" + id ) ;
204
204
p . appendChild ( link ) ;
205
- var buttonType = ""
205
+ var buttonType = "" ;
206
+ var finalFile = "" ;
206
207
if ( name1 == name2 ) {
207
208
buttonType = "changed"
208
- link . appendChild ( document . createTextNode ( name1 ) ) ;
209
+ finalFile = name1 ;
209
210
if ( mode_change )
210
211
p . appendChild ( document . createTextNode ( " mode " + old_mode + " -> " + new_mode ) ) ;
211
212
}
212
213
else if ( name1 == "/dev/null" ) {
213
214
buttonType = "created" ;
214
- link . appendChild ( document . createTextNode ( name2 ) ) ;
215
+ finalFile = name2 ;
215
216
}
216
217
else if ( name2 == "/dev/null" ) {
217
218
buttonType = "deleted" ;
218
- link . appendChild ( document . createTextNode ( name1 ) ) ;
219
+ finalFile = name1 ;
219
220
}
220
221
else {
221
222
buttonType = "renamed" ;
222
- link . appendChild ( document . createTextNode ( name2 ) ) ;
223
+ finalFile = name2 ;
223
224
p . insertBefore ( document . createTextNode ( name1 + " -> " ) , link ) ;
224
225
}
226
+
227
+ link . appendChild ( document . createTextNode ( finalFile ) ) ;
228
+ button . setAttribute ( "representedFile" , finalFile ) ;
229
+ link . setAttribute ( "representedFile" , finalFile ) ;
230
+
225
231
button . setAttribute ( "class" , "button " + buttonType ) ;
226
232
button . appendChild ( document . createTextNode ( buttonType ) ) ;
227
233
$ ( "files" ) . appendChild ( button ) ;
You can’t perform that action at this time.
0 commit comments