fix various js errors

probably due to new cytoscape version
This commit is contained in:
Uwe Steinmann 2020-02-28 18:12:53 +01:00
parent c8df1533e6
commit 23a456e730

View File

@ -185,8 +185,8 @@ cy.on('free', 'node', function(evt) {
});
cy.on('tap', 'node', function(evt) {
var node = evt.cyTarget;
var scratch = node.scratch('app');
var node = evt.target;
var scratch = node.scratch('_app');
if(typeof scratch !== 'undefined') {
noty({
text: (scratch.users ? '<p><?= '<i class="icon-user"></i> ' ?> ' + scratch.users + '</p>' : '') + (scratch.groups ? '<?= '<i class="icon-group"></i> ' ?> ' + scratch.groups + '</p>' : ''),
@ -272,7 +272,7 @@ $(document).ready(function() {
position: {x: ".$positions[$nodeid]->x.", y: ".$positions[$nodeid]->y."}," : "")."
classes: 'action".($iscurtransition ? " current" : ($this->curtransitions ? " light" : ""))."'".(!$this->curtransitions || $iscurtransition && $this->curtransitions ? ",
scratch: {
app: {groups: \"".str_replace('"', "\\\"", implode(", ", $gnames))."\", users: \"".str_replace('"', "\\\"", implode(", ", $unames))."\"}
_app: {groups: \"".str_replace('"', "\\\"", implode(", ", $gnames))."\", users: \"".str_replace('"', "\\\"", implode(", ", $unames))."\"}
}" : "")."
});\n";
}
@ -321,6 +321,7 @@ $(document).ready(function() {
echo "cy.add({
data: {
id: 'E1-".$transition->getID()."',
name: '',
source: 'S".$state->getID()."',
target: 'A".$transition->getID()."-".$action->getID()."'
},
@ -329,6 +330,7 @@ $(document).ready(function() {
echo "cy.add({
data: {
id: 'E2-".$transition->getID()."',
name: '',
source: 'A".$transition->getID()."-".$action->getID()."',
target: 'S".$nextstate->getID()."'
},