Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 5b05b4b8

Přidáno uživatelem Pavel Fidranský před více než 6 roky(ů)

fixed Vertex to display its name w/o archetype

Zobrazit rozdíly:

sources/src/main/webapp/js/components/vertex.js
9 9
	/** @prop {integer} archetype Archetype of the vertex. */
10 10
	this.archetype = app.archetype.vertex[props.archetype];
11 11
	/** @prop {string} name Name of the vertex. */
12
	this.name = props.name;
12
	this.name = props.name.split(':')[1];
13 13
	/** @prop {array} symbol Symbol of the group. */
14 14
	this.symbol = app.markSymbol.getMarkSymbol();
15 15

  
......
18 18

  
19 19
	var position = new Coordinates(0, 0);
20 20
	var size = {
21
		width: Math.max(30 + props.name.length * 8.3, 200),	// 8.3 is approximate width (in pixels) of one character using Consolas at 15px font size
21
		width: Math.max(30 + this.name.length * 8.3, 200),	// 8.3 is approximate width (in pixels) of one character using Consolas at 15px font size
22 22
		height: 30,
23 23
	};
24 24
	var group = null;
......
452 452
			'x': 25,
453 453
			'y': 20,
454 454
		});
455
		nameText.appendChild(document.createTextNode(props.name));
455
		nameText.appendChild(document.createTextNode(this.name));
456 456
		rootElement.appendChild(nameText);
457 457

  
458 458
		// symbol list
......
472 472
	function renderExcluded() {
473 473
		rootElement = app.utils.createHtmlElement('li', {
474 474
			'class': 'node vertex',
475
			'data-id': props.id,
475
			'data-id': this.id,
476 476
		});
477 477

  
478 478
		var svg = app.utils.createSvgElement('svg', {

Také k dispozici: Unified diff