[update] Last version toggle

This commit is contained in:
brunosimon
2016-08-15 13:47:39 +02:00
parent bcabfd7e6d
commit 2a54fe708d
2 changed files with 29 additions and 5 deletions
@@ -76,6 +76,26 @@ application.controller(
} );
};
project.on_new_version = function( data )
{
// Should open last version
if( $scope.always_last_version )
{
// Same file
if( $scope.file && $scope.file.path.full === data.file )
{
$scope.$apply( function()
{
if( $scope.version )
$scope.version.active = false;
$scope.version = data.version;
$scope.version.active = true;
} );
}
}
};
$scope.project = project;
$scope.file = null;
$scope.always_last_version = true;