         @context.viewport.modalProps.show = true
         @setState(show: true)
 
-    hide: ->
-        @_hide()
-        @state.onCancel?()
+    hide: -> @_hide()
 
     render: ->
         return null unless @state.show

            </BS.Modal.Header>

            <BS.Modal.Body style={maxHeight: @context.viewport.height - 250}>
                <Body modal={@} />
            </BS.Modal.Body>

            <BS.Modal.Footer>{buttons}</BS.Modal.Footer>

    getInitialState: ->
        show: false

    onOkButton: (ev) -> @state.onOk?(this, ev)
    onCancelButton: (ev) -> @state.onCancel?(this, ev)
    onButton: (ev, btn) ->
        @selected = btn
        if btn.eventKey is 'ok'
            @onOkButton(ev)
        else
            @onCancelButton(ev)
        @_hide() if @state.autoHide and ev.defaultPrevented isnt true

    componentWillReceiveProps: (nextProps) ->
        @replaceState(nextProps)
