mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-03 04:14:15 +01:00
Added default stylesheet and less structure to create new themes
This commit is contained in:
@@ -94,8 +94,9 @@ var getEndDate = function(prevTime, dateFormat, str){
|
||||
str = str.trim();
|
||||
|
||||
// Check for actual date
|
||||
if(moment(str,dateFormat,true).isValid()){
|
||||
return moment(str,dateFormat).toDate();
|
||||
if(moment(str,dateFormat.trim(),true).isValid()){
|
||||
|
||||
return moment(str,dateFormat.trim()).toDate();
|
||||
}
|
||||
|
||||
var d = moment(prevTime);
|
||||
|
||||
@@ -227,15 +227,36 @@ module.exports.draw = function (text, id) {
|
||||
}
|
||||
}
|
||||
|
||||
var taskType = '';
|
||||
if(d.active){
|
||||
if (d.crit) {
|
||||
taskType = 'activeCritText'+secNum;
|
||||
}else{
|
||||
taskType = 'activeText'+secNum;
|
||||
}
|
||||
}
|
||||
|
||||
if (d.done) {
|
||||
if (d.crit) {
|
||||
taskType = taskType + ' doneCritText'+secNum;
|
||||
}else{
|
||||
taskType = taskType + ' doneText'+secNum;
|
||||
}
|
||||
}else{
|
||||
if (d.crit) {
|
||||
taskType = taskType + ' critText'+secNum;
|
||||
}
|
||||
}
|
||||
|
||||
// Check id text width > width of rectangle
|
||||
if (textWidth > (endX - startX)) {
|
||||
if (endX + textWidth + 1.5*conf.sidePadding > w) {
|
||||
return 'taskTextOutsideLeft taskTextOutside' + secNum;
|
||||
return 'taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;
|
||||
} else {
|
||||
return 'taskTextOutsideRight taskTextOutside' + secNum;
|
||||
return 'taskTextOutsideRight taskTextOutside' + secNum+ ' ' + taskType;
|
||||
}
|
||||
} else {
|
||||
return 'taskText taskText' + secNum;
|
||||
return 'taskText taskText' + secNum+ ' ' + taskType;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user