     if editing
       done = $rootScope.$on '$locationChangeStart', (event, url) ->
         return if url.contains(slot.editRoute())
-        return display.cancelRouteChange(event) unless confirmDirty()
+        return display.cancelRouteChange(event) if stayDirty($flow?.isUploading())
         done()
 ])

      selection: if 'select' of target then new Segment(target.select) else Segment.empty
      position: Offset.parse(target.pos)

    video = undefined
    blank = undefined


        else
          !a.asset - !b.asset || !a.file - !b.file

    stayDirty = (global) ->
      if global || editing && $scope.current && $scope.form.edit && ($scope.current.dirty = $scope.form.edit.$dirty)
        not confirm(constants.message('navigation.confirmation'))

    select = (c) ->
      return false if stayDirty()

      $scope.current = c
      searchLocation($location.replace())
