       $addToSet:
         flycircuit_idids: +value # plus sign converts to integer
 
-    Session.set "editing_flycircuit_idid", null
+    editing_flycircuit_idid.set(null)
     return
 
   cancel: ->
-    Session.set "editing_flycircuit_idid", null
+    editing_flycircuit_idid.set(null)
     return
 )
 
 Template.FlyCircuitPanel.events
   "click .add-flycircuit-idid": (e, tmpl) ->
-    Session.set "editing_flycircuit_idid", @_id
+    editing_flycircuit_idid.set(@_id)
     Deps.flush() # update DOM before focus
     window.activateInput tmpl.find("#edit-flycircuit-input")
     return

Session.setDefault "editing_flycircuit_idid", null

Template.FlyCircuitPanel.events window.okCancelEvents("#edit-flycircuit-input",
  ok: (value) ->


Template.FlyCircuitPanel.helpers
  adding_flycircuit_idid: ->
    editing_flycircuit_idid.get() == @_id

  idid_dicts: ->
    result = []
