mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	foreignObject works. labels work! Yeah!
This commit is contained in:
		
							
								
								
									
										921
									
								
								dist/www/javascripts/lib/mermaid.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										921
									
								
								dist/www/javascripts/lib/mermaid.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -192,6 +192,7 @@ function resolveSVGElement(element) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function resolveForeignObjects(element) {
 | 
			
		||||
    return;
 | 
			
		||||
  var children
 | 
			
		||||
    , textElement
 | 
			
		||||
    , textSpan
 | 
			
		||||
 
 | 
			
		||||
@@ -145,7 +145,10 @@ function renderCommitHistory(svg, commitid, branches, direction) {
 | 
			
		||||
                .text(commit.id);
 | 
			
		||||
            var branch = _.find(branches, ["commit", commit]);
 | 
			
		||||
            if (branch) {
 | 
			
		||||
                svg.select("#node-" + commit.id + " foreignObject")
 | 
			
		||||
                log.debug("found branch ", branch.name);
 | 
			
		||||
                // don't try to select foreignObject - doesn't work.
 | 
			
		||||
                // instead select by class name and it works.
 | 
			
		||||
                svg.select("#node-" + commit.id + " .node-label")
 | 
			
		||||
                    .append("xhtml:p")
 | 
			
		||||
                    .attr("class", "branch-label")
 | 
			
		||||
                    .text(branch.name);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user