if !done
ctxt.targets.each { |target|
if target.name == 'reorder-elements'
- move = Proc.new { |from,to|
+ move_dnd = Proc.new { |from,to|
if from != to
$modified = true
autotable.move(from, to)
end
}
if $multiple_dnd.size == 0
- move.call(selection_data.data.to_i,
- autotable.get_current_number(vbox))
+ move_dnd.call(selection_data.data.to_i,
+ autotable.get_current_number(vbox))
else
UndoHandler.begin_batch
$multiple_dnd.sort { |a,b| autotable.get_current_number($name2widgets[a][:vbox]) <=> autotable.get_current_number($name2widgets[b][:vbox]) }.
each { |path|
#- need to update current position between each call
- move.call(autotable.get_current_number($name2widgets[path][:vbox]),
- autotable.get_current_number(vbox))
+ move_dnd.call(autotable.get_current_number($name2widgets[path][:vbox]),
+ autotable.get_current_number(vbox))
}
UndoHandler.end_batch
end