 
     # a cache to register created views.
     @editors = {}
+    # a map of stack template ids for which editors should be reloaded
+    @shouldReloadMap = {}
 
     @selectedEditor = null
 
     { router } = kd.singletons
     router.on 'RouteInfoHandled', (routeInfo) =>
-      return  unless @selectedEditor
-
-      { data, reloadRequired } = @selectedEditor
-      @removeEditor data.stackTemplate._id  if reloadRequired
+      Object.keys(@shouldReloadMap).forEach @bound 'removeEditor'
 
 
   openEditor: (stackTemplateId) ->


    editor = @editors[templateId]
    delete @editors[templateId]

    editor?.destroy()


    { computeController } = kd.singletons

    EnvironmentFlux.actions.fetchAndUpdateStackTemplate(templateId).then (template) =>
      templateId = template._id
      @shouldReloadMap[templateId] = yes  if @editors[templateId]?


  createEditor: (stackTemplate) ->
