mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
WebHistoryView: Also use the tree context menu
This commit is contained in:
@@ -88,6 +88,8 @@ contextMenuItemsForElement:(NSDictionary *)element
|
||||
NSLog(@"Could not find selected ref!");
|
||||
return defaultMenuItems;
|
||||
}
|
||||
if ([node hasAttributes] && [[node attributes] getNamedItem:@"representedFile"])
|
||||
return [historyController menuItemsForPaths:[NSArray arrayWithObject:[[[node attributes] getNamedItem:@"representedFile"] value]]];
|
||||
|
||||
node = [node parentNode];
|
||||
}
|
||||
|
||||
@@ -202,26 +202,32 @@ var showDiff = function() {
|
||||
var link = document.createElement("a");
|
||||
link.setAttribute("href", "#" + id);
|
||||
p.appendChild(link);
|
||||
var buttonType = ""
|
||||
var buttonType = "";
|
||||
var finalFile = "";
|
||||
if (name1 == name2) {
|
||||
buttonType = "changed"
|
||||
link.appendChild(document.createTextNode(name1));
|
||||
finalFile = name1;
|
||||
if (mode_change)
|
||||
p.appendChild(document.createTextNode(" mode " + old_mode + " -> " + new_mode));
|
||||
}
|
||||
else if (name1 == "/dev/null") {
|
||||
buttonType = "created";
|
||||
link.appendChild(document.createTextNode(name2));
|
||||
finalFile = name2;
|
||||
}
|
||||
else if (name2 == "/dev/null") {
|
||||
buttonType = "deleted";
|
||||
link.appendChild(document.createTextNode(name1));
|
||||
finalFile = name1;
|
||||
}
|
||||
else {
|
||||
buttonType = "renamed";
|
||||
link.appendChild(document.createTextNode(name2));
|
||||
finalFile = name2;
|
||||
p.insertBefore(document.createTextNode(name1 + " -> "), link);
|
||||
}
|
||||
|
||||
link.appendChild(document.createTextNode(finalFile));
|
||||
button.setAttribute("representedFile", finalFile);
|
||||
link.setAttribute("representedFile", finalFile);
|
||||
|
||||
button.setAttribute("class", "button " + buttonType);
|
||||
button.appendChild(document.createTextNode(buttonType));
|
||||
$("files").appendChild(button);
|
||||
|
||||
Reference in New Issue
Block a user