Commit 1a96434f authored by Thibaut Frain's avatar Thibaut Frain Committed by Jérome Perrin

restore previous node edition popup behaviour

parent ab2056a5
......@@ -22,8 +22,13 @@
</script>
<template id="popup-edit-template">
<div id="node-edit-popup">
<form>
<div id="node-edit-popup" data-position-to="origin">
<div data-role="header" data-theme="a">
<h1>Node edition</h1>
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
</div>
<br/>
<form class="ui-content">
<fieldset></fieldset>
<input type="button" value="Delete">
<input type="submit" value="Validate">
......
......@@ -18,7 +18,7 @@
* ==========================================================================*/
/*global RSVP, rJS, $, jsPlumb, Handlebars, initGadgetMixin,
loopEventListener, promiseEventListener, DOMParser, confirm*/
loopEventListener, promiseEventListener, DOMParser, confirm */
/*jslint unparam: true */
(function (RSVP, rJS, $, jsPlumb, Handlebars, initGadgetMixin,
loopEventListener, promiseEventListener, DOMParser) {
......@@ -307,6 +307,11 @@
name: element.name,
element_id: element.element_id
};
Object.keys(element).forEach(function (k) {
if (k !== '_class' && k !== 'name' && k !== 'element_id') {
element_data[k] = element[k];
}
});
node_container[element.id] = element_data;
}
......@@ -519,7 +524,7 @@
property_list.unshift({
"_class": "Dream.Property",
"id": "name",
"name": "name",
"name": "Name",
"type": "string"
});
......@@ -581,7 +586,7 @@
gadget.props.nodes_click_monitor
.monitor(loopEventListener(
node,
'click',
'dblclick',
false,
openNodeDialog.bind(null, gadget, node, config_dict)
));
......@@ -595,6 +600,7 @@
box,
absolute_position,
domElement;
element.element_id = generateElementId(gadget.props.element);
if (!element.id) {
element.id = generateNodeId(gadget, element_type, option);
......@@ -698,7 +704,6 @@
.declareAcquiredMethod('getConfigurationDict', 'getConfigurationDict')
.ready(function (g) {
g.props.node_container = {};
g.props.edge_container = {};
g.props.preference_container = {};
g.props.style_attr_list = [
......@@ -711,6 +716,7 @@
.declareMethod('render', function (data) {
this.props.data = JSON.parse(data);
this.props.node_container = this.props.data.nodes;
this.props.jsplumb_instance = jsPlumb.getInstance();
})
......
......@@ -13,7 +13,7 @@
.innerHTML,
option_template = Handlebars.compile(option_source),
selected_option_source = gadget_klass.__template_element
.getElementById("option-template")
.getElementById("selected-option-template")
.innerHTML,
selected_option_template = Handlebars.compile(selected_option_source);
......@@ -32,8 +32,7 @@
tmp = '';
select.setAttribute('name', field_json.key);
for (i = 0; i < field_json.items.length; i += 1) {
if (field_json.items[i][1] === field_json.default[0]) {
if (field_json.items[i][1] === field_json.value) {
template = selected_option_template;
} else {
template = option_template;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment