mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
CommitView: move index functions to separate controller
This merges functionality that was previously stored in the combination of PBGitCommitController / PBChangedFile to a dedicated controller, PBGitIndexController.
This commit is contained in:
@@ -2,7 +2,7 @@ var showNewFile = function(file)
|
||||
{
|
||||
$('title').innerHTML = "New file: " + file.path;
|
||||
|
||||
var contents = file.unstagedChanges();
|
||||
var contents = IndexController.unstagedChangesForFile_(file);
|
||||
if (!contents) {
|
||||
notify("Can not display changes (Binary file?)", -1);
|
||||
return;
|
||||
@@ -36,11 +36,11 @@ var showFileChanges = function(file, cached) {
|
||||
var changes;
|
||||
if (cached) {
|
||||
$("title").innerHTML = "Staged changes for " + file.path;
|
||||
changes = file.cachedChangesAmend_(Controller.amend());
|
||||
changes = IndexController.stagedChangesForFile_(file);
|
||||
}
|
||||
else {
|
||||
$("title").innerHTML = "Unstaged changes for " + file.path;
|
||||
changes = file.unstagedChanges();
|
||||
changes = IndexController.unstagedChangesForFile_(file);
|
||||
}
|
||||
|
||||
if (changes == "") {
|
||||
|
||||
Reference in New Issue
Block a user