Commit 202a0dc0 authored by Mikaël Salson's avatar Mikaël Salson

Model: A function gives what the name of the current analysis is.

Two reasons:
1. Easier to have something common in many places.
2. Easier to handle different cases: eg. classic filenames and name of patients (as retrieved from the server).
parent c62a23f9
......@@ -511,7 +511,7 @@ Builder.prototype = {
//file name
var div_data_file = document.createElement('div');
div_data_file.id = "info_data_file"
div_data_file.appendChild(document.createTextNode(this.m.dataFileName));
div_data_file.appendChild(document.createTextNode(this.m.getPrintableAnalysisName()));
parent.appendChild(div_data_file)
//global info
......@@ -744,4 +744,4 @@ Builder.prototype = {
},
}
\ No newline at end of file
}
......@@ -899,6 +899,19 @@ Model.prototype = {
}
}, //end getCloneName
/**
* return a name that can be displayed gracefully
* (either with a real filename, or a name coming from the database).
*/
getPrintableAnalysisName : function() {
var ext = this.dataFileName.lastIndexOf(".")
if (ext > 0) {
return this.dataFileName.substr(0, ext)
} else {
return this.dataFileName
}
},
/* return custom name of cloneID,
* or return segmentation name
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment