     defaultOptions:
         content: ''
         showCloseButton: true
+        escapeButtonCloses: true
         overlayClosesOnClick: true
         appendLocation: 'body'
         className: ''


    close: (id) ->
        if not id
            $lastVexContent = vex.getAllVexes().last()
            return false unless $lastVexContent.length
            id = $lastVexContent.data().vex.id

        return vex.closeByID id



        return true

    closeByEscape: ->
        ids = vex.getAllVexes().map(-> $(@).data().vex.id).toArray()
        return false unless ids and ids.length

        id = ids.sort().reverse()[0]
        $lastVex = vex.getVexByID id
        return false if $lastVex.data().vex.escapeButtonCloses isnt true

        return vex.closeByID id

    hideLoading:  ->
        $('.vex-loading-spinner').remove()

