       'toolbar-button': true
       'thin-button': true
       'disabled': not @state.isEnabled
-    zoom = switch
+    onClick = switch
+      when !@state.isEnabled then ->
       when inOrOut == 'in' then -> lc.zoom(0.2)
       when inOrOut == 'out' then -> lc.zoom(-0.2)
-    onClick = if @state.isEnabled then zoom else ->
 
     (div {className, onClick}, switch
       when inOrOut == 'in' then '+'

  # However, this component really does read and write only to the 'undo'
  # part of the state bucket, and we have to get react to update somehow, and
  # we don't want the parent to have to worry about this, so it's in @state.
  getState: -> {isEnabled: @props.lc.canUndo()}
  getInitialState: -> @getState()
  mixins: [LC.React.Mixins.UpdateOnDrawingChangeMixin]


    )


createUndoRedoButtonComponent = (undoOrRedo) -> React.createClass
  displayName: if undoOrRedo == 'undo' then 'UndoButton' else 'RedoButton'

  # We do this a lot, even though it reads as a React no-no.
  # The reason is that '@props.lc' is a monolithic state bucket for
