             when 'top'
               v = info.metric.options[v]
             when 'summary'
-              if info.d.global
-                if Editing
-                  cell.classList.add('spreadsheet-global-record-cell')
-                  del = cell.appendChild(document.createElement('a'))
-                  del.className = 'button mini global-record white icon-text'
-                  delicon = del.appendChild(document.createElement('span'))
-                  delicon.className = 'icon trash'
-                  del.appendChild(document.createTextNode('Remove'))
-                  $(del).on 'click', $scope.$lift(clickGlobal)
+              if info.d.global && Editing
+                cell.classList.add('spreadsheet-global-record-cell')
+                del = cell.appendChild(document.createElement('a'))
+                del.className = 'button mini global-record white icon-text'
+                delicon = del.appendChild(document.createElement('span'))
+                delicon.className = 'icon trash'
+                del.appendChild(document.createTextNode('Remove'))
+                $(del).on 'click', $scope.$lift(clickGlobal)
             else
               if info.metric.type == 'void' && info.d
                 cell.className = 'clickable' if Editing && Key.id != info.c

            info.cell = info.tr.appendChild(document.createElement('td'))
            generateText(info)
            return
          if info.category.id == 'slot' && info.slot.global
            generateCell(l-1) # summary
            info.cell.setAttribute("colspan", l)
            return

'use strict'

app.directive 'spreadsheet', [
  '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'
