Commit 43d45930 authored by matjaz's avatar matjaz
Browse files

Bug correction, Slight restyle of sortables.

- Corrected bug: when connection is removed during the process of input to parameter conversion - it was not reflected on the UI.
- Slight restyle: visibility of drop position is enhanced and move cursor is used now.
parent 69a3c00e
...@@ -164,6 +164,7 @@ td{ ...@@ -164,6 +164,7 @@ td{
} }
.sortable { list-style-type: none; margin: 0; padding: 0; } .sortable { list-style-type: none; margin: 0; padding: 0; }
.sortable li { margin: 0 2px 2px 2px; padding: 0.4em; padding-left: 1.5em; } .sortable li { margin: 0 2px 2px 2px; padding: 0.4em; padding-left: 1.5em; height: 1.2em; cursor: move;}
.sortable .ui-state-highlight { height: 1.2em; }
.sortable li span { position: absolute; margin-left: -1.3em; } .sortable li span { position: absolute; margin-left: -1.3em; }
...@@ -590,6 +590,12 @@ function updateWidgetListeners() { ...@@ -590,6 +590,12 @@ function updateWidgetListeners() {
if (data.changed || data.reordered) { if (data.changed || data.reordered) {
unfinish(widgetId); unfinish(widgetId);
refreshWidget(widgetId, activeCanvasId); refreshWidget(widgetId, activeCanvasId);
for (var i=0; i< data.deletedConnections.length; i++) {
var conId = data.deletedConnections[i];
$("#drawingcanvas"+conId).remove();
$("#drawingoutline"+conId).remove();
delete connections[conId];
}
$('#widgetpreferences-'+widgetId).remove(); $('#widgetpreferences-'+widgetId).remove();
$('#widgetconfiguration-'+widgetId).remove(); $('#widgetconfiguration-'+widgetId).remove();
reportStatus("Successfully saved widget configuration."); reportStatus("Successfully saved widget configuration.");
...@@ -1037,8 +1043,9 @@ function openConfiguration(thisWidgetId) { ...@@ -1037,8 +1043,9 @@ function openConfiguration(thisWidgetId) {
updateWidgetListeners(); updateWidgetListeners();
fileListeners(); fileListeners();
dialog = $("#widgetconfiguration-"+thisWidgetId); dialog = $("#widgetconfiguration-"+thisWidgetId);
$( "#inputs, #params" ).sortable({connectWith:".inputsParams"}).disableSelection(); $("#params").sortable({connectWith:".inputsParams", placeholder:"ui-state-highlight"}).disableSelection();
$( "#outputs" ).sortable().disableSelection(); $("#inputs").sortable({connectWith:".inputsParams", placeholder:"ui-state-highlight"}).disableSelection();
$("#outputs").sortable({placeholder:"ui-state-highlight"}).disableSelection();
dialog.dialog('open'); dialog.dialog('open');
},'html'); },'html');
} else { } else {
......
...@@ -648,6 +648,7 @@ def save_configuration(request): ...@@ -648,6 +648,7 @@ def save_configuration(request):
outputs = request.POST.getlist('outputs') outputs = request.POST.getlist('outputs')
changed = False changed = False
reordered = False reordered = False
deletedConnections = []
for (id, input) in enumerate(inputs): for (id, input) in enumerate(inputs):
inp = get_object_or_404(Input, pk=input) inp = get_object_or_404(Input, pk=input)
id += 1 id += 1
...@@ -669,6 +670,7 @@ def save_configuration(request): ...@@ -669,6 +670,7 @@ def save_configuration(request):
if (not inp.parameter): if (not inp.parameter):
#need to be careful if connections are set up to this input and need to be removed #need to be careful if connections are set up to this input and need to be removed
for c in Connection.objects.filter(input=inp): for c in Connection.objects.filter(input=inp):
deletedConnections.append(c.id)
c.delete() c.delete()
inp.parameter = True inp.parameter = True
changed = True changed = True
...@@ -689,7 +691,7 @@ def save_configuration(request): ...@@ -689,7 +691,7 @@ def save_configuration(request):
if (changed): if (changed):
widget.unfinish() widget.unfinish()
data = simplejson.dumps({'changed':changed,'reordered':reordered}) data = simplejson.dumps({'changed':changed,'reordered':reordered, 'deletedConnections':deletedConnections})
mimetype = 'application/javascript' mimetype = 'application/javascript'
return HttpResponse(data, mimetype) return HttpResponse(data, mimetype)
else: else:
......
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