Revize d87ebc88
Přidáno uživatelem Martin Matas před téměř 6 roky(ů)
sources/imiger-core/src/main/webapp/js/timeline/auxiliary/RestSource.js | ||
---|---|---|
79 | 79 |
_convertGraph : function(data) { |
80 | 80 |
var archetypes = data.vertexArchetypes; |
81 | 81 |
var nodes = new Array(data.vertices.length), edges = new Array(data.edges.length); |
82 |
var attrNames = data.attributeTypes.map(function(attr) { return attr.name; }) |
|
83 |
,beginAttrIdx = attrNames.indexOf('begin') |
|
84 |
,endAttrIdx = attrNames.indexOf('end'); |
|
82 | 85 |
|
83 | 86 |
for(var i = 0; i < data.vertices.length; i++) { |
84 | 87 |
var v = data.vertices[i]; |
... | ... | |
95 | 98 |
name: v.name, |
96 | 99 |
description: v.text, |
97 | 100 |
stereotype: archetype, |
98 |
properties: prop, |
|
99 |
begin: v.attributes[1][1] |
|
101 |
properties: prop |
|
100 | 102 |
}; |
101 |
if (typeof v.attributes[2] !== 'undefined') { |
|
102 |
node.end = v.attributes[2][1]; |
|
103 |
if (beginAttrIdx !== -1 && typeof v.attributes[beginAttrIdx] !== 'undefined') { |
|
104 |
node.begin = v.attributes[beginAttrIdx][1]; |
|
105 |
} |
|
106 |
if (endAttrIdx !== -1 && typeof v.attributes[endAttrIdx] !== 'undefined') { |
|
107 |
node.end = v.attributes[endAttrIdx][1]; |
|
103 | 108 |
} |
104 | 109 |
nodes[i] = node; |
105 | 110 |
} |
sources/imiger-core/src/main/webapp/js/timeline/cz/kajda/timeline/Timeline.js | ||
---|---|---|
632 | 632 |
var ev = new CustomEvent('timelineClick', { detail: entity.getId() }); |
633 | 633 |
window.parent.document.dispatchEvent(ev); |
634 | 634 |
|
635 |
if (this._selected) { |
|
636 |
this.blur(); |
|
637 |
e.preventDefault(); |
|
638 |
this._selected = false; |
|
639 |
if (this._selectedEntity === entity.getId()) { |
|
640 |
return; |
|
635 |
if (document.modeForm.mode.value === 'move' && e.altKey === false) { |
|
636 |
if (this._selected) { |
|
637 |
this.blur(); |
|
638 |
e.preventDefault(); |
|
639 |
this._selected = false; |
|
640 |
if (this._selectedEntity === entity.getId()) { |
|
641 |
return; |
|
642 |
} |
|
641 | 643 |
} |
644 |
|
|
645 |
this.focusItem(bandItem.getEntity(), false); |
|
646 |
this._fireEvent("itemClick", entity); |
|
647 |
// FIALA Event for item click |
|
648 |
this._fireEvent("itemLogClick", entity); |
|
649 |
this._selected = true; |
|
650 |
this._selectedEntity = entity.getId(); |
|
642 | 651 |
} |
643 |
|
|
644 |
this.focusItem(bandItem.getEntity(), false); |
|
645 |
this._fireEvent("itemClick", entity); |
|
646 |
// FIALA Event for item click |
|
647 |
this._fireEvent("itemLogClick", entity); |
|
648 |
this._selected = true; |
|
649 |
this._selectedEntity = entity.getId(); |
|
650 | 652 |
}, |
651 | 653 |
|
652 | 654 |
/** |
Také k dispozici: Unified diff
Fixed problems with interactions, generalized loading process of attributes from JSON (refs #7516)