         LayoutActionCreator.refreshMessages()
 
     toggleEdited: ->
-        @setState edited: not @state.edited
+        if @state.edited
+            @setState allSelected: false, edited: false, selected: {}
+        else
+            @setState edited: true
+
+    toggleAll: ->
+        if @state.allSelected
+            @setState allSelected: false, edited: false, selected: {}
+        else
+            selected = {}
+            @props.messages.map (message, key) ->
+                selected[key] = true
+            .toJS()
+            @setState allSelected: true, edited: true, selected: selected
 
     onDelete: ->
-        selected = Object.keys @_selected
+        selected = Object.keys @state.selected
         if selected.length is 0
             alertError t 'list mass no message'
         else

                        if @state.edited
                            div className: 'btn-group btn-group-sm message-list-option',
                                button
                                    className: 'btn btn-default trash',
                                    type: 'button',
                                    onClick: @onDelete,
                                        span
                                            className: 'fa fa-trash-o'

                            window.cozyMails.messageNavigate()

    onMark: (args) ->
        selected = Object.keys @state.selected
        if selected.length is 0
            alertError t 'list mass no message'
        else
