Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
dffb297b
Commit
dffb297b
authored
Nov 21, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not use "node_container"
parent
72760be8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
dream/platform/src/jsplumb/jsplumb.js
dream/platform/src/jsplumb/jsplumb.js
+11
-13
No files found.
dream/platform/src/jsplumb/jsplumb.js
View file @
dffb297b
...
...
@@ -108,7 +108,7 @@
var
n
=
1
,
class_def
=
gadget
.
props
.
data
.
class_definition
[
element
.
_class
],
id
=
class_def
.
short_id
||
element
.
_class
;
while
(
gadget
.
props
.
node_container
[
id
+
n
]
!==
undefined
)
{
while
(
gadget
.
props
.
data
.
graph
.
node
[
id
+
n
]
!==
undefined
)
{
n
+=
1
;
}
return
id
+
n
;
...
...
@@ -206,7 +206,7 @@
};
}
gadget
.
props
.
node_container
[
node_id
].
coordinate
=
coordinate
;
gadget
.
props
.
data
.
graph
.
node
[
node_id
].
coordinate
=
coordinate
;
gadget
.
notifyDataChanged
();
return
coordinate
;
}
...
...
@@ -353,7 +353,7 @@
$
(
gadget
.
props
.
element
).
find
(
"
#
"
+
element_id
)
);
$
(
gadget
.
props
.
element
).
find
(
"
#
"
+
element_id
).
remove
();
delete
gadget
.
props
.
node_container
[
node_id
];
delete
gadget
.
props
.
data
.
graph
.
node
[
node_id
];
$
.
each
(
gadget
.
props
.
edge_container
,
function
(
k
,
v
)
{
if
(
node_id
===
v
[
0
]
||
node_id
===
v
[
1
])
{
...
...
@@ -368,19 +368,18 @@
// XXX should probably not use data.data
var
element_id
=
gadget
.
props
.
node_id_to_dom_element_id
[
node_id
],
new_id
=
data
.
id
;
console
.
log
(
'
ued
'
,
node_id
,
data
);
if
(
data
.
data
.
name
)
{
$
(
gadget
.
props
.
element
).
find
(
"
#
"
+
element_id
).
text
(
data
.
data
.
name
)
.
append
(
'
<div class="ep"></div></div>
'
);
gadget
.
props
.
node_container
[
node_id
].
name
=
data
.
data
.
name
;
gadget
.
props
.
data
.
graph
.
node
[
node_id
].
name
=
data
.
data
.
name
;
}
delete
data
.
id
;
$
.
extend
(
gadget
.
props
.
node_container
[
node_id
],
data
.
data
);
$
.
extend
(
gadget
.
props
.
data
.
graph
.
node
[
node_id
],
data
.
data
);
if
(
new_id
&&
new_id
!==
node_id
)
{
gadget
.
props
.
node_container
[
new_id
]
=
gadget
.
props
.
node_container
[
node_id
];
delete
gadget
.
props
.
node_container
[
node_id
];
delete
gadget
.
props
.
node_container
[
new_id
].
id
;
gadget
.
props
.
data
.
graph
.
node
[
new_id
]
=
gadget
.
props
.
data
.
graph
.
node
[
node_id
];
delete
gadget
.
props
.
data
.
graph
.
node
[
node_id
];
delete
gadget
.
props
.
data
.
graph
.
node
[
new_id
].
id
;
$
.
each
(
gadget
.
props
.
edge_container
,
function
(
k
,
v
)
{
if
(
v
[
0
]
===
node_id
)
{
v
[
0
]
=
new_id
;
...
...
@@ -444,7 +443,7 @@
// TODO: remove class_definition from this function and callees signature
function
openNodeDialog
(
gadget
,
element
,
class_definition
)
{
var
node_id
=
getNodeId
(
gadget
,
element
.
id
),
node_data
=
gadget
.
props
.
node_container
[
node_id
],
node_data
=
gadget
.
props
.
data
.
graph
.
node
[
node_id
],
node_edit_popup
=
$
(
gadget
.
props
.
element
).
find
(
'
#popup-edit-template
'
),
schema
=
expandSchema
(
class_definition
,
gadget
.
props
.
data
),
fieldset_element
,
...
...
@@ -549,7 +548,7 @@
gadget
.
props
.
node_id_to_dom_element_id
[
node_id
]
=
dom_element_id
;
node_data
.
name
=
node_data
.
name
||
class_definition
.
name
;
gadget
.
props
.
node_container
[
node_id
]
=
node_data
;
gadget
.
props
.
data
.
graph
.
node
[
node_id
]
=
node_data
;
if
(
coordinate
===
undefined
)
{
coordinate
=
{
top
:
0
,
left
:
0
}
...
...
@@ -660,7 +659,6 @@
.
declareMethod
(
'
render
'
,
function
(
data
)
{
this
.
props
.
data
=
JSON
.
parse
(
data
);
this
.
props
.
node_container
=
this
.
props
.
data
.
graph
.
node
;
this
.
props
.
jsplumb_instance
=
jsPlumb
.
getInstance
();
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment