 'use strict'
 
 app.directive 'spreadsheet', [
-  'constantService', 'displayService', 'messageService', 'tooltipService', 'styleService', '$compile', '$templateCache', '$timeout', '$document', '$location', '$filter', 'routerService', 'storageService', 'Segment',
-  (constants, display, messages, tooltips, styles, $compile, $templateCache, $timeout, $document, $location, $filter, router, storage, Segment) ->
+  'constantService', 'displayService', 'messageService', 'tooltipService', 'styleService', '$compile', '$templateCache', '$timeout', '$document', '$location', '$filter', '$route', 'routerService', 'storageService', 'Segment',
+  (constants, display, messages, tooltips, styles, $compile, $templateCache, $timeout, $document, $location, $filter, $route, router, storage, Segment) ->
     restrict: 'E'
     scope: true
     templateUrl: 'volume/spreadsheet.html'

            else if info.count
              router.http(router.controllers.deleteRecordAllSlot, rec.id).then () ->
                volume.top.addRecord(rec).then () ->
                  # TODO
                  rec.global = true
                  return
            else
              volume.top.addRecord(rec).then () ->
                rec.global = true
                info.row.set(info.c, info.n, populateSlotData(volume.top))
                return
          saveRun info.cell, act.then () ->
            collapse()
            generateRow(info.i)
            expand(info) if info.n

                td.id = ID + '-no_' + info.i + '_' + info.c
          else
            if Editing && info.c == 'slot' && Key.id != 'slot' && t == SlotCount && !info.row.partial && info.row.key
              # TODO: style, this action is irreversable
              add = td.appendChild(document.createElement('a'))
              add.className = 'button mini white global-record icon-text'
              add.appendChild(document.createTextNode('Convert to whole volume'))
              $(add).on 'click', $scope.$lift(clickGlobal)
            td.appendChild(document.createTextNode(t + " " + info.category.name + "s"))
            td.className = 'more'
